How does a search functionality fit in DDD with CQRS?
| Newsgroups | gmane.comp.programming.domain-driven-design |
|---|---|
| Message-ID | <[email protected]> |
In Vaughn Vernon https://github.com/VaughnVernon's book Implementing domain driven design and the accompanying sample application https://github.com/VaughnVernon/IDDD_Samples I found that he implemented a CQRS approach to the iddd_collaboration https://github.com/VaughnVernon/IDDD_Samples/tree/master/iddd_collaboration/src/main/java/com/saasovation/collaboration/application/calendar 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 https://github.com/VaughnVernon/IDDD_Samples/blob/master/iddd_collaboration/src/main/java/com/saasovation/collaboration/application/calendar/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? just clutter everything in the Query service? https://github.com/VaughnVernon/IDDD_Samples/blob/master/iddd_collaboration/src/main/java/com/saasovation/collaboration/application/calendar/CalendarQueryService.java VaughnVernon/IDDD_Samples https://github.com/VaughnVernon/IDDD_Samples/blob/master/iddd_collaboration/src/main/java/com/saasovation/collaboration/application/calendar/CalendarQueryService.java IDDD_Samples - These are the sample Bounded Contexts from the book... View on github.com https://github.com/VaughnVernon/IDDD_Samples/blob/master/iddd_collaboration/src/main/java/com/saasovation/collaboration/application/calendar/CalendarQueryService.java Preview by Yahoo