Reader small image

You're reading from  Domain-Driven Design with Java - A Practitioner's Guide

Product typeBook
Published inAug 2022
PublisherPackt
ISBN-139781800560734
Edition1st Edition
Tools
Right arrow
Authors (2):
Premanand Chandrasekaran
Premanand Chandrasekaran
author image
Premanand Chandrasekaran

Premanand Chandrasekaran is a technology leader and change agent, with a solid track record of leading large technology teams and helping businesses deliver mission-critical problems while exhibiting high internal and external quality. In the past two decades, he has had the pleasure of helping a variety of clients and domains, including financial services, online retailers, education, and healthcare startups. His specialties include technical innovation, architecture, continuous delivery, agile/iterative transformation, and employee development. When not fiddling with his trusty laptop, he spends time cutting vegetables, cooking, playing video games, and analyzing the nuances of the game of cricket.
Read more about Premanand Chandrasekaran

Karthik Krishnan
Karthik Krishnan
author image
Karthik Krishnan

Karthik Krishnan is a technology leader with over 25 years of experience in designing and building large-scale enterprise solutions across financial and retail domains. He has played numerous technical roles in leading product development for major financial institutions. He is currently serving the role of Technical Principal at Thoughtworks. He is passionate about platform thinking, solution architecture, application security and strives to be known as a coding architect. His most recent assignment entailed leading a large technology team helping their clients in their legacy modernization journey with Cloud. When not working, he spends time practicing playing tunes on his musical keyboard.
Read more about Karthik Krishnan

View More author details
Right arrow

Implementing the query side

In Chapter 5, Implementing Domain Logic, we examined how to publish events when a command is successfully processed. Now, let’s look at how we can construct a query model by listening to these domain events. Logically, this will look something like the following diagram:

Figure 7.2 – The CQRS application – the query side

For a detailed explanation of how the command side is implemented, please refer to the Implementing the command side section in Chapter 5, Implementing Domain Logic.

The high-level sequence on the query side is described here:

  1. An event listening component listens to these domain events published on the event bus.
  2. It constructs a purpose-built query model to satisfy a specific query use case.
  3. This query model is persisted in a datastore optimized for read operations.
  4. This query model is then exposed in the form of an API.

Note how there can exist more than one query...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Domain-Driven Design with Java - A Practitioner's Guide
Published in: Aug 2022Publisher: PacktISBN-13: 9781800560734

Authors (2)

author image
Premanand Chandrasekaran

Premanand Chandrasekaran is a technology leader and change agent, with a solid track record of leading large technology teams and helping businesses deliver mission-critical problems while exhibiting high internal and external quality. In the past two decades, he has had the pleasure of helping a variety of clients and domains, including financial services, online retailers, education, and healthcare startups. His specialties include technical innovation, architecture, continuous delivery, agile/iterative transformation, and employee development. When not fiddling with his trusty laptop, he spends time cutting vegetables, cooking, playing video games, and analyzing the nuances of the game of cricket.
Read more about Premanand Chandrasekaran

author image
Karthik Krishnan

Karthik Krishnan is a technology leader with over 25 years of experience in designing and building large-scale enterprise solutions across financial and retail domains. He has played numerous technical roles in leading product development for major financial institutions. He is currently serving the role of Technical Principal at Thoughtworks. He is passionate about platform thinking, solution architecture, application security and strives to be known as a coding architect. His most recent assignment entailed leading a large technology team helping their clients in their legacy modernization journey with Cloud. When not working, he spends time practicing playing tunes on his musical keyboard.
Read more about Karthik Krishnan