for example, I have a user table, to be layer-ing, I create such POJOs:
UserEntity.java
UserDao.java
UserBO.java (business object, domain model?)
UserService.java (for service layer)
what's the difference between UserBO.java and UserService.java? why we seperate it to two objects?
Application Layer: Mediates between the Presentation and Domain Layers. Orchestrates business objects to perform specific application tasks. Implements use cases as the application logic. Domain Layer: Includes business objects and the core (domain) business rules.
The domain layer is an optional layer that sits between the UI layer and the data layer. Figure 1. The domain layer's role in app architecture. The domain layer is responsible for encapsulating complex business logic, or simple business logic that is reused by multiple ViewModels.
The main difference between them is that domain services hold domain logic whereas application services don't. As we discussed in a previous post, domain logic is everything that is related to business decisions.
In service-oriented architecture (SOA), the service layer is the third layer in a five-abstraction-layer model. The model consists of Object layer, Component layer, Service layer, Process layer and Enterprise layer.
The Domain Model contains information and functionality related to what it means to be a User. It should map conceptually onto something that exists physically in the real world or a clearly defined concept in the problem space.
The Service contains information and functionality related to performing atomic units of work. It should map conceptually onto tasks that are performed on or by members of the Domain model. A single atomic task performed by clicking a button in the application generally involves many members of the Domain working together, unless you app is just a CRUD-y electronic filing cabinet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With