Re: How does a search functionality fit in DDD with CQRS?
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
In our projects, we handle queries in a similar manner to commands. In our API controllers we map to or construct a query object. The query object is passed to a query processor for processing. Internally, the query processor routes the query object to it's corresponding query handler. It's an effective approach per you can encapsulate the details of the query processing into a separate handler. We create a ReadModel assembly that contains the POCO/POJO read model classes and a ReadModel.Query assembly that contains the query specifications and query handlers. App.ReadModel: POCO/POJO objects App.ReadModel.Queries: Query specifications and query handlers App.Infastructure: Interfaces for query specifications and QueryProcessor implementation.