0%

Book Description

Learn to solve complex business problems by understanding users better, finding the right problem to solve, and building lean event-driven systems to give your customers what they really want.

About This Book
  • Understand and implement the DDD approach to software design and development
  • Learn how DDD applies directly to various architectural styles such as REST, reactive systems, and microservices
  • Provide a level of independence to the teams, more refined capabilities of services, and more decoupled interactions
Who This Book Is For

This book is for .NET developers, who know C# at intermediate level; 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 You Will Learn
  • Discover domain complexity together with business stakeholders
  • Avoid common pitfalls when creating the domain model
  • Understand 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
  • Figure out CQRS and to-the-point read models with projections
  • Practice building one-way flow UI with Vue.js
  • Learn how task-based UI matches with DDD principles
  • Understand how to develop complex systems in ever changing world
In Detail

Developers across the world are rapidly adopting Domain-Driven Design principles that deliver powerful results in writing software dealing with complex business requirements. This book will help you involve business stakeholders into discussions about the software you are planning to build for them. By figuring out the temporal nature of behavior-driven domain models and understanding that language lives in a context, you will be able to build leaner, more agile, and modular systems, which adapt to the constant flow of changes that life brings.

The book starts off by uncovering domain complexity and how to capture the behavior aspect of the domain language. You will understand EventStorming before using it on design level. With more knowledge about the domain, we will create a new .NET Core project and write some code to transfer our events from sticky notes to C#. The book will show how to use aggregates to handle commands and produce events. You will learn about 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. You will learn about refactoring towards deeper insight and essentials about event versioning and migrations.

After reading this book, you will be confident in implementing the DDD approach at your organization and also explore new techniques that complement your learning from the book.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the code file.

Table of Contents

  1. Preface
  2. Why Domain-Driven Design
    1. Understanding the problem
      1. Problem space and solution space
      2. What went wrong with requirements
    2. Dealing with complexity
      1. Types of complexity
      2. Categorizing complexity
      3. Decision making and biases
    3. Knowledge
      1. Domain knowledge
      2. Avoiding ignorance
    4. Summary
    5. Further reading
  3. Language and Context
    1. Ubiquitous language
      1. Domain language
        1. Sample application domain
      2. Making implicit explicit
        1. Domain language for classified ads
    2. Language and context
    3. Summary
  4. EventStorming
    1. EventStorming
      1. Modeling language
      2. Visualization
    2. Facilitating an EventStorming workshop
      1. Who to invite
      2. Preparing the space
        1. Materials
        2. The room 
      3. The workshop
        1. Timing and scheduling
        2. The beginning
        3. During the workshop
        4. After the workshop
    3. Our first model
    4. Summary
    5. Further Reading
  5. Designing the Model
    1. Introduction
    2. Domain model
      1. What does the model represent
      2. Anemic domain model
        1. Functional languages and anemic models
      3. What to include in the domain model
        1. Design considerations
        2. CQRS
    3. Design-level EventStorming
      1. Getting deeper knowledge
      2. Preparation for the workshop
      3. Extended notation
        1. Commands
        2. Read models
        3. Users
        4. Policies
        5. All together now
      4. Modeling the reference domain
    4. Summary
    5. Further reading
  6. Implementing the Model
    1. Introduction
    2. Technical requirements
    3. Starting up the implementation
      1. Creating projects
      2. The Framework
    4. Transferring the model to code
      1. Entities
        1. Identities
        2. Classified Ad entity
      2. Adding behavior
    5. Ensuring correctness
      1. Constraints for input values
      2. Value objects
        1. Factories
        2. Domain services
        3. Entity invariants
    6. Domain events in code
      1. Domain events as objects
      2. Raising events
      3. Events change state
    7. Summary
  7. Acting with Commands
    1. Technical requirements
    2. Outside the domain model
      1. Exposing Web API
        1. Public API contracts
        2. HTTP endpoints
      2. Application layer
    3. Command handling
      1. Command handler pattern
      2. Application service
    4. Summary
  8. Consistency Boundary
  9. Bounded Context
  10. Event Sourcing
  11. Projections and Queries
  12. Integration with Events
  13. Setting Things Up
  14. Task-Based UI
  15. One-Way Flow
  16. Refactoring
  17. Versioning of Events
  18. New Horizons
18.226.133.49