Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

naming convention for domain services and application services with DDD

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 ?

like image 802
Mik378 Avatar asked Apr 29 '12 18:04

Mik378


People also ask

What are domain services in DDD?

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.

What is the difference between domain and application?

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.

What is DDD pattern?

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.

What is domain and service?

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.


1 Answers

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

like image 182
GingerHead Avatar answered Oct 20 '22 00:10

GingerHead