In a scenario where CQRS and Domain Driven Design approachs are used in conjunction, is it allowed to implement the ‘Query side model’ in an anemic style?
In my opinion:
The domain driven design concepts fit well with the ‘Command side’,where the business logic is implemented and business rules/invariants must be ensured/granted.
The Query side is supposed to be always valid, as a result of the Command side. The Query model’s goal should be the most convenient and performant way to retrieve data, then checking business rules and invariants.
As a result, I would implements two different models: the ‘rich’ data model, for Command side, in a DDD style and the ‘anemic’ data model, for the Query side.
What DDD suggest about these points? Is there something more to consider?
Thank you
I think you have a valid approach. The query side doesn't need complex models, just simple DTOs to act as containers for the data.
This idea is supported in .NET Microservices: Architecture for Containerized .NET Applications, top of page 187.