Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Domain-Driven Design with Java - A Practitioner's Guide

You're reading from   Domain-Driven Design with Java - A Practitioner's Guide Create simple, elegant, and valuable software solutions for complex business problems

Arrow left icon
Product type Paperback
Published in Aug 2022
Publisher Packt
ISBN-13 9781800560734
Length 302 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Karthik Krishnan Karthik Krishnan
Author Profile Icon Karthik Krishnan
Karthik Krishnan
Premanand Chandrasekaran Premanand Chandrasekaran
Author Profile Icon Premanand Chandrasekaran
Premanand Chandrasekaran
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Part 1: Foundations
2. Chapter 1: The Rationale for Domain-Driven Design FREE CHAPTER 3. Chapter 2: Where and How Does DDD Fit? 4. Part 2: Real-World DDD
5. Chapter 3: Understanding the Domain 6. Chapter 4: Domain Analysis and Modeling 7. Chapter 5: Implementing Domain Logic 8. Chapter 6: Implementing the User Interface – Task-Based 9. Chapter 7: Implementing Queries 10. Chapter 8: Implementing Long-Running Workflows 11. Chapter 9: Integrating with External Systems 12. Part 3: Evolution Patterns
13. Chapter 10: Beginning the Decomposition Journey 14. Chapter 11: Decomposing into Finer-Grained Components 15. Chapter 12: Beyond Functional Requirements 16. Other Books You May Enjoy

Implementing the command side

In this section, we will focus on implementing the command side of the application. This is where we expect all the business logic of the application to be implemented. Logically, it looks like the following figure:

Figure 5.2 – Traditional versus CQRS architecture

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

  1. A request to mutate state (command) is received.
  2. In an event-sourced system, the command model is constructed by replaying existing events that have occurred for that instance. In a state-stored system, we would simply restore state by reading state from the persistence store.
  3. If business invariants (validations) are satisfied, one or more domain events are readied with the intention to be published.
  4. In an event-sourced system, the domain event is persisted on the command side. In a state-stored system, we would update the state of the instance in the persistence store.
  5. The...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime