You are previewing Patterns, Principles, and Practices of Domain-Driven Design.
O'Reilly logo
Patterns, Principles, and Practices of Domain-Driven Design

Book Description

Methods for managing complex software construction following the practices, principles and patterns of Domain-Driven Design with code examples in C#

This book presents the philosophy of Domain-Driven Design (DDD) in a down-to-earth and practical manner for experienced developers building applications for complex domains. A focus is placed on the principles and practices of decomposing a complex problem space as well as the implementation patterns and best practices for shaping a maintainable solution space. You will learn how to build effective domain models through the use of tactical patterns and how to retain their integrity by applying the strategic patterns of DDD. Full end-to-end coding examples demonstrate techniques for integrating a decomposed and distributed solution space while coding best practices and patterns advise you on how to architect applications for maintenance and scale.

  • Offers a thorough introduction to the philosophy of DDD for professional developers
  • Includes masses of code and examples of concept in action that other books have only covered theoretically
  • Covers the patterns of CQRS, Messaging, REST, Event Sourcing and Event-Driven Architectures
  • Also ideal for Java developers who want to better understand the implementation of DDD

Table of Contents

  1. Introduction
    1. Overview of the Book and Technology
    2. How This Book Is Organized
    3. Who Should Read This Book
    4. Source Code
    5. Errata
    6. p2p.wrox.com
    7. Summary
  2. Part I: The Principles and Practices of Domain-Driven Design
    1. Chapter 1: What Is Domain-Driven Design?
      1. The Challenges of Creating Software for Complex Problem Domains
      2. How the Patterns of Domain-Driven Design Manage Complexity
      3. The Practices and Principles of Domain-Driven Design
      4. Popular Misconceptions of Domain-Driven Design
      5. The Salient Points
    2. Chapter 2: Distilling the Problem Domain
      1. Knowledge Crunching and Collaboration
      2. Gaining Domain Insight with Domain Experts
      3. Patterns for Effective Knowledge Crunching
      4. Look For Existing Models
      5. The Salient Points
    3. Chapter 3: Focusing on the Core Domain
      1. Why Decompose a Problem Domain?
      2. How to Capture the Essence of the Problem
      3. How to Focus on the Core Problem
      4. How Subdomains Shape a Solution
      5. Not All Parts of a System Will Be Well Designed
      6. What If You Have No Core Domain?
      7. The Salient Points
    4. Chapter 4: Model-Driven Design
      1. What Is a Domain Model?
      2. Model-Driven Design
      3. Using a Ubiquitous Language to Bind the Analysis to the Code Model
      4. Collaborating on a Ubiquitous Language
      5. How to Create Effective Domain Models
      6. When to Apply Model-Driven Design
      7. The Salient Points
    5. Chapter 5: Domain Model Implementation Patterns
      1. The Domain Layer
      2. Domain Model Implementation Patterns
      3. The Salient Points
    6. Chapter 6: Maintaining the Integrity of Domain Models with Bounded Contexts
      1. The Challenges of a Single Model
      2. Use Bounded Contexts to Divide and Conquer a Large Model
      3. Implementing Bounded Contexts
      4. The Salient Points
    7. Chapter 7: Context Mapping
      1. A Reality Map
      2. Recognising the Relationships between Bounded Contexts
      3. Communicating the Context Map
      4. The Strategic Importance of Context Maps
      5. The Salient Points
    8. Chapter 8: Application Architecture
      1. Application Architecture
      2. Application Services
      3. Application Clients
      4. The Salient Points
    9. Chapter 9: Common Problems for Teams Starting Out with Domain-Driven Design
      1. Overemphasizing the Importance of Tactical Patterns
      2. Missing the Real Value of DDD: Collaboration, Communication, and Context
      3. Spending Too Much Time on What’s Not Important
      4. Making Simple Problems Complex
      5. Underestimating the Cost of Applying DDD
      6. The Salient Points
    10. Chapter 10: Applying the Principles, Practices, and Patterns of DDD
      1. Selling DDD
      2. Applying the Principles of DDD
      3. Exploration and Experimentation
      4. Making the Implicit Explicit
      5. A Problem Solver First, A Technologist Second
      6. How Do I Know That I Am Doing It Right?
      7. The Salient Points
  3. Part II: Strategic Patterns: Communicating Between Bounded Contexts
    1. Chapter 11: Introduction to Bounded Context Integration
      1. How to Integrate Bounded Contexts
      2. Integrating Distributed Bounded Contexts
      3. The Challenges of DDD with Distributed Systems
      4. SOA and Reactive DDD
      5. The Salient Points
    2. Chapter 12: Integrating via Messaging
      1. Messaging Fundamentals
      2. Building an E-Commerce Application with NServiceBus
      3. Maintaining a Messaging Application
      4. Integrating a Bounded Context with Mass Transit
      5. The Salient Points
    3. Chapter 13: Integrating via HTTP with RPC and REST
      1. Why Prefer HTTP?
      2. RPC
      3. REST
      4. The Salient Points
  4. Part III: Tactical Patterns: Creating Effective Domain Models
    1. Chapter 14: Introducing the Domain Modeling Building Blocks
      1. Tactical Patterns
      2. Patterns to Model Your Domain
      3. LifeCycle Patterns
      4. Emerging Patterns
      5. The Salient Points
    2. Chapter 15: Value Objects
      1. When to Use a Value Object
      2. Defining Characteristics
      3. Common Modeling Patterns
      4. Persistence
      5. The Salient Points
    3. Chapter 16: Entities
      1. Understanding Entities
      2. Implementing Entities
      3. Common Entity Modeling Principles and Patterns
      4. The Salient Points
    4. Chapter 17: Domain Services
      1. Understanding Domain Services
      2. Utilizing Domain Services
      3. The Salient Points
    5. Chapter 18: Domain Events
      1. Essence of the Domain Events Pattern
      2. Event Handling Actions
      3. Domain Events’ Implementation Patterns
      4. Testing Domain Events
      5. The Salient Points
    6. Chapter 19: Aggregates
      1. Managing Complex Object Graphs
      2. Aggregates
      3. Defining Aggregate Boundaries
      4. Implementing Aggregates
      5. The Salient Points
    7. Chapter 20: Factories
      1. The Role of a Factory
      2. The Salient Points
    8. Chapter 21: Repositories
      1. Repositories
      2. A Misunderstood Pattern
      3. Aggregate Persistence Strategies
      4. A Repository Is an Explicit Contract
      5. Transaction Management and Units of Work
      6. To Save or Not To Save
      7. The Repository as an Anticorruption Layer
      8. Other Responsibilities of a Repository
      9. Repository Antipatterns
      10. Repository Implementations
      11. The Salient Points
    9. Chapter 22: Event Sourcing
      1. The Limitations of Storing State as a Snapshot
      2. Gaining Competitive Advantage by Storing State as a Stream of Events
      3. Event-Sourced Aggregates
      4. Building an Event Store
      5. Using the Purpose-Built Event Store
      6. CQRS with Event Sourcing
      7. Recapping the Benefits of Event Sourcing
      8. Weighing the Costs of Event Sourcing
      9. Additional Learning Resources
      10. The Salient Points
  5. Part IV: Design Patterns for Effective Applications
    1. Chapter 23: Architecting Application User Interfaces
      1. Design Considerations
      2. Example 1: An HTML API-Based, Server-Side UI for Nondistributed Bounded Contexts
      3. Example 2: A Data API-Based, Client-Side UI for Distributed Bounded Contexts
      4. The Salient Points
    2. Chapter 24: CQRS: An Architecture of a Bounded Context
      1. The Challenges of Maintaining a Single Model for Two Contexts
      2. A Better Architecture for Complex Bounded Contexts
      3. The Command Side: Business Tasks
      4. The Query Side: Domain Reporting
      5. The Misconceptions of CQRS
      6. Patterns to Enable Your Application to Scale
      7. The Salient Points
    3. Chapter 25: Commands: Application Service Patterns for Processing Business Use Cases
      1. Differentiating Application Logic and Domain Logic
      2. Application Service Patterns
      3. Testing Application Services
      4. The Salient Points
    4. Chapter 26: Queries: Domain Reporting
      1. Domain Reporting Within a Bounded Context
      2. Domain Reporting Across Bounded Contexts
      3. The Salient Points
  6. Title Page
  7. Copyright
  8. Dedication
  9. About the Author
  10. Credits
  11. Acknowledgments
  12. Advert
  13. EULA