Clearly, I didn't explain myself well. In my understanding, a domain service would not interact with a repository, since a domain service is a domain object just like an entity, except without data.
So, in the DDD book, Services are described starting on page 104. The example is actually of a funds transfer. The idea is that Account might have credit and debit methods, but the transfer method doesn't belong to either account and would be better in a domain service, FundsTransferDomainService. FundsTransferAppService uses the domain service and takes care of the non-domain effects.
It seems like what you're describing in chapter 3 is more properly an application service, because it is calling the repository.
Entities and value objects are defined with ADTs, so they map to those same concepts from OO DDD, but without the behavior.
The domain behavior exists separate from the entities and value objects, so that would seem to map to domain services.
Wiring the domain behavior with other things like persistence would seem to map to application services.
Did that explain it any better?
|