Patterns, Principles, and Practices of Domain-Driven Design

1. Auflage Mai 2015
800 Seiten, Softcover
Praktikerbuch
Kurzbeschreibung
Applications, code, and case studies for using domain-driven design techniques in software development
This book presents the philosophy of domain-driven design in a down-to-earth and practical manner for experienced developers, showing them how to apply concepts of DDD to their applications using real-world examples. Unlike other books on the subject, it's packed with patterns, code, and case studies that back-up the theory with practical examples. It includes development best practices and patterns, covers CQRS architecture, and features a case study that applies DDD, CQRS, and Messaging Publishing/Subscribe architecture in a real-world set of enterprise applications.
* 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
* Also ideal for Java developers who want to better understand the implementation of DDD and CQRS
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
PART I: THE PRINCIPLES AND PRACTICES OF DOMAIN-DRIVEN DESIGN
CHAPTER 1: WHAT IS DOMAIN-DRIVEN DESIGN? 3
The Challenges of Creating Software for Complex Problem Domains 4
How the Patterns of Domain-Driven Design Manage Complexity 6
The Practices and Principles of Domain-Driven Design 11
Popular Misconceptions of Domain-Driven Design 12
The Salient Points 13
CHAPTER 2: DISTILLING THE PROBLEM DOMAIN 15
Knowledge Crunching and Collaboration 15
Gaining Domain Insight with Domain Experts 18
Patterns for Effective Knowledge Crunching 19
Look For Existing Models 24
The Salient Points 29
CHAPTER 3: FOCUSING ON THE CORE DOMAIN 31
Why Decompose a Problem Domain? 31
How to Capture the Essence of the Problem 32
How to Focus on the Core Problem 33
Treat Your Core Domain as a Product Rather than a Project 36
How Subdomains Shape a Solution 37
Not All Parts of a System will be Well Designed 37
What if You Have no Core Domain? 39
The Salient Points 40
CHAPTER 4: MODEL?]DRIVEN DESIGN 41
What Is a Domain Model? 42
Model-Driven Design 44
Using a Ubiquitous Language to Bind the Analysis to the Code Model 47
Collaborating on a Ubiquitous Language 48
How to Create Effective Domain Models 52
When to Apply Model?]Driven Design 56
The Salient Points 57
CHAPTER 5: DOMAIN MODEL IMPLEMENTATION PATTERNS 59
The Domain Layer 60
Domain Model Implementation Patterns 60
The Salient Points 71
CHAPTER 6: MAINTAINING THE INTEGRITY OF DOMAIN MODELS WITH BOUNDED CONTEXTS 73
The Challenges of a Single Model 74
Use Bounded Contexts to Divide and Conquer a Large Model 79
Implementing Bounded Contexts 85
The Salient Points 89
CHAPTER 7: CONTEXT MAPPING 91
A Reality Map 92
Recognising the Relationships between Bounded Contexts 95
Communicating the Context Map 100
The Strategic Importance of Context Maps 101
The Salient Points 103
CHAPTER 8: APPLICATION ARCHITECTURE 105
Application Architecture 105
Application Services 112
Application Clients 117
The Salient Points 120
CHAPTER 9: COMMON PROBLEMS FOR TEAMS STARTING OUT WITH DOMAIN?]DRIVEN DESIGN 121
Overemphasizing the Importance of Tactical Patterns 122
Missing the Real Value of DDD: Collaboration, Communication, and Context 124
Producing a Big Ball of Mud Due to Underestimating the Importance of Context 124
Causing Ambiguity and Misinterpretations by Failing to Create a UL 125
Designing Technical-Focused Solutions Due to a Lack of Collaboration 125
Spending Too Much Time on What's Not Important 126
Making Simple Problems Complex 126
Underestimating the Cost of Applying DDD 127
The Salient Points 130
CHAPTER 10: APPLYING THE PRINCIPLES, PRACTICES, AND PATTERNS OF DDD 131
Selling DDD 132
Applying the Principles of DDD 133
Exploration and Experimentation 142
Making the Implicit Explicit 143
A Problem Solver First, A Technologist Second 146
How Do I Know That I Am Doing It Right? 146
The Salient Points 147
PART II: STRATEGIC PATTERNS: COMMUNICATING BETWEEN BOUNDED CONTEXTS
CHAPTER 11: INTRODUCTION TO BOUNDED CONTEXT INTEGRATION 151
How to Integrate Bounded Contexts 152
Integrating Distributed Bounded Contexts 161
The Challenges of DDD with Distributed Systems 165
SOA and Reactive DDD 174
The Salient Points 180
CHAPTER 12: INTEGRATING VIA MESSAGING 181
Messaging Fundamentals 182
Building an E-Commerce Application with NServiceBus 186
Maintaining a Messaging Application 227
Integrating a Bounded Context with Mass Transit 235
The Salient Points 243
CHAPTER 13: INTEGRATING VIA HTTP WITH RPC AND REST 245
Why Prefer HTTP? 247
RPC 248
REST 264
The Salient Points 305
PART III: TACTICAL PATTERNS: CREATING EFFECTIVE DOMAIN MODELS
CHAPTER 14: INTRODUCING THE DOMAIN MODELING BUILDING BLOCKS 309
Tactical Patterns 310
Patterns to Model Your Domain 310
Lifecycle Patterns 318
Emerging Patterns 324
The Salient Points 327
CHAPTER 15: VALUE OBJECTS 329
When to Use a Value Object 330
Defining Characteristics 333
Common Modeling Patterns 345
Persistence 351
The Salient Points 359
CHAPTER 16: ENTITIES 361
Understanding Entities 362
Implementing Entities 363
Common Entity Modeling Principles and Patterns 380
The Salient Points 388
CHAPTER 17: DOMAIN SERVICES 389
Understanding Domain Services 390
Utilizing Domain Services 397
The Salient Points 403
CHAPTER 18: DOMAIN EVENTS 405
Essence of the Domain Events Pattern 406
Event Handling Actions 409
Domain Events' Implementation Patterns 410
Testing Domain Events 422
The Salient Points 425
CHAPTER 19: AGGREGATES 427
Managing Complex Object Graphs 428
Aggregates 434
Defining Aggregate Boundaries 442
Implementing Aggregates 450
The Salient Points 468
CHAPTER 20: FACTORIES 469
The Role of a Factory 469
The Salient Points 477
CHAPTER 21: REPOSITORIES 479
Repositories 479
A Misunderstood Pattern 481
Aggregate Persistence Strategies 486
A Repository Is an Explicit Contract 492
Transaction Management and Units of Work 493
To Save or Not To Save 497
The Repository as an Anticorruption Layer 499
Other Responsibilities of a Repository 500
Repository Antipatterns 506
Repository Implementations 508
The Salient Points 593
CHAPTER 22: EVENT SOURCING 595
The Limitations of Storing State as a Snapshot 596
Gaining Competitive Advantage by Storing State as a Stream of Events 597
Event-Sourced Aggregates 600
Building an Event Store 611
Using the Purpose-Built Event Store 627
CQRS with Event Sourcing 637
Recapping the Benefits of Event Sourcing 639
Weighing the Costs of Event Sourcing 640
Additional Learning Resources 641
The Salient Points 641
PART IV: DESIGN PATTERNS FOR EFFECTIVE APPLICATIONS
CHAPTER 23: ARCHITECTING APPLICATION USER INTERFACES 645
Design Considerations 646
Example 1: An HTML API-Based, Server-Side UI for Nondistributed Bounded Contexts 651
Example 2: A Data API-Based, Client-Side UI for Distributed Bounded Contexts 658
The Salient Points 667
CHAPTER 24: CQRS: AN ARCHITECTURE OF A BOUNDED CONTEXT 669
The Challenges of Maintaining a Single Model for Two Contexts 670
A Better Architecture for Complex Bounded Contexts 670
The Command Side: Business Tasks 672
The Query Side: Domain Reporting 676
The Misconceptions of CQRS 679
Patterns to Enable Your Application to Scale 680
The Salient Points 685
CHAPTER 25: COMMANDS: APPLICATION SERVICE PATTERNS FOR PROCESSING BUSINESS USE CASES 687
Differentiating Application Logic and Domain Logic 689
Application Service Patterns 700
Testing Application Services 709
The Salient Points 712
CHAPTER 26: QUERIES: DOMAIN REPORTING 713
Domain Reporting within a Bounded Context 714
Domain Reporting Across Bounded Contexts 733
The Salient Points 736
INDEX 737