Domain Services are services that encapsulate domain logic which does not naturally fit within the responsibilities of a single entity or value object. They represent operations and behaviors that are important to the business domain and typically involve multiple entities.


First Introduced Early 2000s
Introduced by Eric Evans
Source Domain-Driven Design: Tackling Complexity in the Heart of Software
Used by Amazon, Lufthansa Systems, Microsoft, Vanguard, Confluent

What are the key characteristics of a Domain Service?

The key characteristics of a Domain Service include encapsulating domain logic that involves multiple entities, being stateless, and focusing on operations and behaviors that do not naturally belong to a single entity. Domain Services are an essential part of the domain model and align closely with business processes.

How do Domain Services differ from Application Services?

Domain Services focus on encapsulating domain-specific business logic and operations, while Application Services are responsible for orchestrating and coordinating the use of Domain Services, entities, and value objects to fulfill application use cases. Application Services typically handle infrastructure concerns, transaction management, and user interactions.

When should you use a Domain Service in your design?

You should use a Domain Service when a particular piece of business logic or operation involves multiple entities or value objects and does not naturally fit within the responsibilities of a single entity. Domain Services help to keep your domain model clean and maintainable by centralizing complex operations that span across multiple parts of the domain.