DAO: wrapper methods for wrapping JPA or JDBC or SQL or noSQL or any other calls to access database systems.
Domain: business logic calls correlate with one type of object (domain object).
Service: business logic calls correlate with a group of entity types or with a group of several objects of the same type.
(I'm not sure about English, sorry .......)
This means: The service level is “greater” than the domain level, often close to the interface, often calls or uses several domain objects.
Domain objects encapsulate most of the materials for one part of the domain (therefore they are called DO)
DAO is just technical, sometimes needed, sometimes not. When real domain objects are used, often “repositories” are used to hide access to database systems or add special db functionality or something else.
front-end → service method 1 → do A type X, do B type X, List
xtraclass
source share