In DDD approach, what is the best-practice for naming domain services components and application services components ?
For instance, should I have within my application layer a service named : RoomReservationService and in my domain layer a service named also RoomReservationService; the first delegating to the other ?
Actually, when an application service does not gather many domain services, that means I can't find distinct names between them, how could I name it without introducing any confusion ?
Domain Services (or just Services in DDD) is used to perform domain operations and business rules. In his DDD book, Eric Evans describes a good Service in three characteristics: The operation relates to a domain concept that is not a natural part of an Entity or Value Object.
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.
DDD patterns help you understand the complexity in the domain. For the domain model for each Bounded Context, you identify and define the entities, value objects, and aggregates that model your domain. You build and refine a domain model that is contained within a boundary that defines your context.
Domain Services stores centralized directory information and lets users and domains communicate. When a user attempts to connect to a device or resource on a network, this service provides login authentication, verifying the user's login credentials and access permissions.
In DDD You can use the same approach as remote services applications:
Application layer service name : RoomReservationService
In package name : com.my.package.service.RoomReservationService
Domain layer service name : RoomReservationDomainService
In package name : com.my.package.domain.service.RoomReservationDomainService
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