Query Side and the Read Models

As we’ve seen before, Hexagonal Architecture limitations have a lot to do with mixing Queries and Commands, and one of the biggest problems while trying to apply Domain-Driven Design is when the Domain Model gets spoiled with low-level presentation details. These details are mostly related to the Read side of the Data Model — such as a large number of reading methods, getters in Domain objects that break encapsulation, or bloating Aggregates in non-optimal ways for the sake of the presentation — and they make it difficult, if not impossible, to optimize Queries.

Once we split our application and extract our Queries into the Read Model, there won’t be a need for Domain intermediation or extra complexity while handling ...

Get CQRS by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.