Wrap-Up

In this chapter we discussed what a Domain Service is and what it is not, and we analyzed when we should use a Service rather than an operation on an Entity or Value Object. There was more:

• You learned that recognizing a legitimate need for a Service is necessary to avoid overusing Services.

• You were reminded that overuse of Domain Services leads to Anemic Domain Model, an anti-pattern.

• You saw the specific steps of general practice when implementing a Service.

• You considered the pluses and minuses of using a Separated Interface.

• You reviewed a sample calculation process from the Agile Project Management Context.

• Finally, you considered how to provide exemplary tests to demonstrate how to use the Services our models provide. ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.