Inside an Application Service

Looking at A+ES inside an Application Service (4, 14) demonstrates the big picture. It’s common for Aggregates to reside inside a domain model behind Application Services, which serve as the direct clients of the domain model.

When an Application Service receives control, it loads an Aggregate and retrieves any supporting Domain Services (7) needed by the Aggregate’s business operation. When the Application Service delegates to the Aggregate business operation, the Aggregate’s method produces Events as the outcome. Those Events mutate the state of the Aggregate and are also published as notifications to all subscribers. The Aggregate’s business method may require passing one or more Domain Services as parameters. ...

Get Implementing Domain-Driven Design now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.