▶Book Description
Developers across the world are rapidly adopting DDD principles to deliver powerful results when writing software that deals with complex business requirements. This book will guide you in involving business stakeholders when choosing the software you are planning to build for them. By figuring out the temporal nature of behavior-driven domain models, you will be able to build leaner, more agile, and modular systems.
You’ll begin by uncovering domain complexity and learn how to capture the behavioral aspects of the domain language. You will then learn about EventStorming and advance to creating a new project in .NET Core 2.1; you’ll also and write some code to transfer your events from sticky notes to C#. The book will show you how to use aggregates to handle commands and produce events. As you progress, you’ll get to grips with Bounded Contexts, Context Map, Event Sourcing, and CQRS. After translating domain models into executable C# code, you will create a frontend for your application using Vue.js. In addition to this, you’ll learn how to refactor your code and cover event versioning and migration essentials.
By the end of this DDD book, you will have gained the confidence to implement the DDD approach in your organization and be able to explore new techniques that complement what you’ve learned from the book.
▶What You Will Learn
- Discover and resolve domain complexity together with business stakeholders
- Avoid common pitfalls when creating the domain model
- Study the concept of Bounded Context and aggregate
- Design and build temporal models based on behavior and not only data
- Explore benefits and drawbacks of Event Sourcing
- Get acquainted with CQRS and to-the-point read models with projections
- Practice building one-way flow UI with Vue.js
- Understand how a task-based UI conforms to DDD principles
▶Key Features
- Apply DDD principles using modern tools such as EventStorming, Event Sourcing, and CQRS
- Learn how DDD applies directly to various architectural styles such as REST, reactive systems, and microservices
- Empower teams to work flexibly with improved services and decoupled interactions
▶Who This Book Is For
This book is for .NET developers who have an intermediate level understanding of C#, and for those who seek to deliver value, not just write code. Intermediate level of competence in JavaScript will be helpful to follow the UI chapters.
▶What this book covers
- Chapter 1, Why Domain-Driven Design?, covers the concepts of problem and solution spaces, requirements specifications, complexity, knowledge, and ignorance. These topics have a significant impact on how and what we deliver.
- Chapter 2, Language and Context, deep dives into the importance of language and explains Ubiquitous Language.
- Chapter 3, EventStorming, explores one of the most popular techniques for domain modeling and goes through some practical tips on how to organize useful workshops between domain experts and developers.
- Chapter 4, Designing the Model, goes deeper into the modeling process, with more of a focus on artifacts that can help us to start writing code and deliver initial prototypes as soon as possible.
- Chapter 5, Implementing the Model, forms the basis for our domain model implemented in code. We will go through different styles of performing the behavior in domain entities and also write some tests.
- Chapter 6, Acting with Commands, shows how to implement commands, and how commands are the glue between our domain model and the world outside it. We will learn how to make our model useful by letting people interact with it.
- Chapter 7, Consistency Boundary, takes a closer look at entity persistence, and its scope will be our focus. We will learn what types of consistency we need to deal with and how important it is to understand consistency boundaries.
- Chapter 8, Aggregate Persistence, takes a deep dive into the topic of aggregate persistence. We will find a way to store our domain objects in a database and see our application working for the first time.
- Chapter 9, CQRS - The Read Side, covers the read side of CQRS and explains what the read models are. You will learn how to use Ubiquitous Language for queries and see how to implement CQRS with one database.
- Chapter 10, Event Sourcing, shows how events can be used to persist the state of an object, instead of using traditional persistence mechanisms. We will cover the concept of event streams and see how streams relate to aggregates. We will use the Event Store to persist our aggregates in streams and load them back.
- Chapter 11, Projections and Queries, takes you through the challenges of querying the Event Sourced system and solving these challenges by using separate read models and projections.
- Chapter 12, Bounded Context, makes you familiar with the concept of Bounded Contexts. We will identify contexts in our project and separate the system into pieces. We will also learn about the Context Map, which shows the landscape of Bounded Contexts for the entire system and their relationships.