How does a search functionality fit in DDD with CQRS?

Posted by Songo on Programmers See other posts from Programmers or by Songo
Published on 2014-05-20T22:12:40Z Indexed on 2014/05/26 22:00 UTC
Read the original article Hit count: 341

In Vaughn Vernon's book Implementing domain driven design and the accompanying sample application I found that he implemented a CQRS approach to the iddd_collaboration bounded context.

He presents the following classes in the application service layer:

  • CalendarApplicationService.java
  • CalendarEntryApplicationService.java
  • CalendarEntryQueryService.java
  • CalendarQueryService.java

I'm interested to know if an application will have a search page that feature numerous drop downs and check boxes with a smart text box to match different search patterns; How will you structure all that search logic?

In a command service or a query service?

Taking a look at the CalendarQueryService.java I can see that it has 2 methods for a huge query, but no logic at all to mix and match any search filters for example.

I've heard that the application layer shouldn't have any business logic, so where will I construct my dynamic query? or maybe just clutter everything in the Query service?

© Programmers or respective owner

Related posts about design

Related posts about object-oriented