Re: Re: How does a search functionality fit in DDD with CQRS?
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <CAKqMafwm5CmR7GH5tM_e4Aj8FFs2F2yQWiQD7-ATNuNQrpT17A@mail.gmail.com> |
If you apply DDD with CQRS, which l always recommend, then this means that you will apply DDD only for the command-side of your application. As far as I see it, you are then free to design and implement the query-side as you like. So, if you have a page with lots of search filters, just construct a QueryRequest-message that contains all those filters (presumable with a lot of optional fields) and implement a method/service in your back-end that handles this query and returns the appropriate QueryResponse. Conceptually, the service(s) that handle your queries can be thought of being part of the same Api-layer where the commands arrive, but physically you can separate them completely if you want to. Where exactly the SQL is implemented is also entirely up to you. Vernon has chosen to put the SQL into the application-code (the QueryService), but you may also just call a stored procedure or something. Does this answer your question? On Fri, May 30, 2014 at 1:01 AM, [email protected] [domaindrivendesign] <[email protected]> wrote: > > > Any ideas anyone? > >