Re: How does a search functionality fit in DDD with CQRS?
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
Thanks for the detailed reply. I'm very new to CQRS, but I'm totally sold. I currently do use DDD for commands (write-operations) only. However, I used to treat my queries similarly (Controller/Action -> App service -> Domain layer -> infrastructure layer) then I read Vernon's book and found that I can apply CQRS initially by generating a QueryService class in the Application layer. I see few problems with this approach: 1- What if my data store changes? let's say some objects will be retrieved from a web service call instead of a direct database query? With Vernon's current implementation I will have to clutter everything into a single Query class which is obviously not best way to do it. 2- I may need few helper services to construct my query. Where should these services be stored? in the app layer or the infrastructure layer? I'm referencing IDDD too much here because it has lot's of simple examples for a CQRS beginner like me :)