In re-reading the book, I'm seeing that Evans spoke about 3 types of classes in the domain:
- Value Objects
- [Domain] Services
- Every class had a PK-mapped identity from the db.
- I had not used the Value Object abstraction to group attributes using composition (eg. Person.Address).
- My use of services had been limited to services outside the domain (application and infrastructure, defined below.) As a consequence, I had observed a design issue in my domain entities: even though though they had thorough test coverage, the entities had become large, with many methods. As a result, the tests that ran against these entities by definition had to be coarse grained, often testing logic nested several levels deep within the entity..
With this question in the back of my mind, Evans explanation of Domain Service classes made perfect sense. They belong inside the domain and serve the entities as useful abstractions in their own right. And they are not to be confused with either:
- Application services (eg. the controller in MVC, or a web method); or
- Infrastructure services (eg. adapters on calls to external infrastructure outside the application.)