“Eric Evans has written a fantastic book on how you can make the design of your software match your mental model of the problem domain you are addressing.
“His book is very compatible with XP. It is not about drawing pictures of a domain; it is about how you think of it, the language you use to talk about it, and how you organize your software to reflect your improving understanding of it. Eric thinks that learning about your problem domain is as likely to happen at the end of your project as at the beginning, and so refactoring is a big part of his technique.
“The book is a fun read. Eric has lots of interesting stories, and he has a way with words. I see this book as essential reading for software developers—it is a future classic.”
—Ralph Johnson, author of Design Patterns
“If you don’t think you are getting value from your investment in object-oriented programming, this book will tell you what you’ve forgotten to do.
“Eric Evans convincingly argues for the importance of domain modeling as the central focus of development and provides a solid framework and set of techniques for accomplishing it. This is timeless wisdom, and will hold up long after the methodologies du jour have gone out of fashion.”
—Dave Collins, author of Designing Object-Oriented User Interfaces
“Eric weaves real-world experience modeling—and building—business applications into a practical, useful book. Written from the perspective of a trusted practitioner, Eric’s descriptions of ubiquitous language, the benefits of sharing models with users, object life-cycle management, logical and physical application structuring, and the process and results of deep refactoring are major contributions to our field.”
—Luke Hohmann, author of Beyond Software Architecture
“This book belongs on the shelf of every thoughtful software developer.”
“What Eric has managed to capture is a part of the design process that experienced object designers have always used, but that we have been singularly unsuccessful as a group in conveying to the rest of the industry. We've given away bits and pieces of this knowledge...but we've never organized and systematized the principles of building domain logic. This book is important.”
—Kyle Brown, author of Enterprise Java™ Programming with IBM® WebSphere®
The software development community widely acknowledges that domain modeling is central to software design. Through domain models, software developers are able to express rich functionality and translate it into a software implementation that truly serves the needs of its users. But despite its obvious importance, there are few practical resources that explain how to incorporate effective domain modeling into the software development process.
Domain-Driven Design fills that need. This is not a book about specific technologies. It offers readers a systematic approach to domain-driven design, presenting an extensive set of design best practices, experience-based techniques, and fundamental principles that facilitate the development of software projects facing complex domains. Intertwining design and development practice, this book incorporates numerous examples based on actual projects to illustrate the application of domain-driven design to real-world software development.
Readers learn how to use a domain model to make a complex development effort more focused and dynamic. A core of best practices and standard patterns provides a common language for the development team. A shift in emphasis—refactoring not just the code but the model underlying the code—in combination with the frequent iterations of Agile development leads to deeper insight into domains and enhanced communication between domain expert and programmer. Domain-Driven Design then builds on this foundation, and addresses modeling and design for complex systems and larger organizations.Specific topics covered include:
- Getting all team members to speak the same language
- Connecting model and implementation more deeply
- Sharpening key distinctions in a model
- Managing the lifecycle of a domain object
- Writing domain code that is safe to combine in elaborate ways
- Making complex code obvious and predictable
- Formulating a domain vision statement
- Distilling the core of a complex domain
- Digging out implicit concepts needed in the model
- Applying analysis patterns
- Relating design patterns to the model
- Maintaining model integrity in a large system
- Dealing with coexisting models on the same project
- Organizing systems with large-scale structures
- Recognizing and responding to modeling breakthroughs
With this book in hand, object-oriented developers, system analysts, and designers will have the guidance they need to organize and focus their work, create rich and useful domain models, and leverage those models into quality, long-lasting software implementations.
Foreword. Preface. Acknowledgments.
I. PUTTING THE DOMAIN MODEL TO WORK.
1. Crunching Knowledge.
Ingredients of Effective Modeling.
2. Communication and the Use of Language.
Modeling Out Loud.
One Team, One Language.
Documents and Diagrams.
Written Design Documents.
3. Binding Model and Implementation.
Modeling Paradigms and Tool Support.
Letting the Bones Show: Why Models Matter to Users.
II. THE BUILDING BLOCKS OF A MODEL-DRIVEN DESIGN.
4. Isolating the Domain.
Relating the Layers.
The Domain Layer Is Where the Model Lives.
THE SMART UI “ANTI-PATTERN”
Other Kinds of Isolation.
5. A Model Expressed in Software.
ENTITIES (A.K.A. REFERENCE OBJECTS).
Designing the Identity Operation.
Designing VALUE OBJECTS.
Designing Associations That Involve VALUE OBJECTS.
SERVICES and the Isolated Domain Layer.
Access to SERVICES.
MODULES (A.K.A. PACKAGES).
The Pitfalls of Infrastructure-Driven Packaging.
Why the Object Paradigm Predominates.
Nonobjects in an Object World.
Sticking with MODEL-DRIVEN DESIGN When Mixing Paradigms.
6. The Life Cycle of a Domain Object.
Choosing FACTORIES and Their Sites.
When a Constructor Is All You Need.
Designing the Interface.
Where Does Invariant Logic Go?
ENTITY FACTORIES Versus VALUE OBJECT FACTORIES.
Reconstituting Stored Objects.
Querying a REPOSITORY.
Client Code Ignores REPOSITORY Implementation; Developers Do Not.
Implementing a REPOSITORY.
Working Within Your Frameworks.
The Relationship with FACTORIES.
Designing Objects for Relational Databases.
7. Using the Language: An Extended Example.
Introducing the Cargo Shipping System.
Isolating the Domain: Introducing the Applications.
Distinguishing ENTITIES and VALUE OBJECTS.
Role and Other Attributes.
Designing Associations in the Shipping Domain.
Walking Through Scenarios.
Sample Application Feature: Changing the Destination of a Cargo.
Sample Application Feature: Repeat Business.
FACTORIES and Constructors for Cargo.
Adding a Handling Event.
Pause for Refactoring: An Alternative Design of the Cargo AGGREGATE.
MODULES in the Shipping Model.
Introducing a New Feature: Allocation Checking.
Connecting the Two Systems.
Enhancing the Model: Segmenting the Business.
A Final Look.
III. REFACTORING TOWARD DEEPER INSIGHT.
Story of a Breakthrough.
A Decent Model, and Yet….
A Deeper Model.
A Sobering Decision.
Focus on Basics.
Epilogue: A Cascade of New Insights.
9. Making Implicit Concepts Explicit.
Digging Out Concepts.
Listen to Language.
Read the Book.
Try, Try Again.
How to Model Less Obvious Kinds of Concepts.
Processes as Domain Objects.
Applying and Implementing SPECIFICATION.
10. Supple Design.
CLOSURE OF OPERATIONS.
A Declarative Style of Design.
Extending SPECIFICATIONS in a Declarative Style.
Angles of Attack.
Carve Off Subdomains.
Draw on Established Formalisms, When You Can.
11. Applying Analysis Patterns.
12. Relating Design Patterns to the Model.
STRATEGY (A.K.A. POLICY).
Why Not FLYWEIGHT?
13. Refactoring Toward Deeper Insight.
A Design for Developers.
Crisis as Opportunity.
IV. STRATEGIC DESIGN.
14. Maintaining Model Integrity.
Recognizing Splinters Within a BOUNDED CONTEXT
Testing at the CONTEXT Boundaries.
Organizing and Documenting CONTEXT MAPS.
Relationships Between BOUNDED CONTEXTS.
CUSTOMER/SUPPLIER DEVELOPMENT TEAMS.
Designing the Interface of the ANTICORRUPTION LAYER.
Implementing the ANTICORRUPTION LAYER.
A Cautionary Tale.
OPEN HOST SERVICE.
Unifying an Elephant.
Choosing Your Model Context Strategy.
Team Decision or Higher.
Putting Ourselves in Context.
Accepting That Which We Cannot Change: Delineating the External Systems.
Relationships with the External Systems.
The System Under Design.
Catering to Special Needs with Distinct Models.
When Your Project Is Already Under Way.
Merging CONTEXTS: SEPARATE WAYS—SHARED KERNEL.
Merging CONTEXTS: SHARED KERNEL—CONTINUOUS INTEGRATION.
Phasing Out a Legacy System.
OPEN HOST SERVICE—PUBLISHED LANGUAGE.
Choosing the CORE.
Who Does the Work?
An Escalation of Distillations.
Generic Doesn't Mean Reusable.
Project Risk Management.
DOMAIN VISION STATEMENT.
The Distillation Document.
The Flagged CORE.
The Distillation Document as Process Tool.
GENERIC SUBDOMAIN Versus COHESIVE MECHANISM.
When a MECHANISM Is Part of the CORE DOMAIN.
Distilling to a Declarative Style.
The Costs of Creating a SEGREGATED CORE.
Evolving Team Decision.
Deep Models Distill.
Choosing Refactoring Targets.
16. Large-Scale Structure.
The “Naive Metaphor” and Why We Don't Need It.
Choosing Appropriate Layers.
PLUGGABLE COMPONENT FRAMEWORK.
How Restrictive Should a Structure Be?
Refactoring Toward a Fitting Structure.
Communication and Self-Discipline.
Restructuring Yields Supple Design.
Distillation Lightens the Load.
17. Bringing the Strategy Together.
Combining Large-Scale Structures and BOUNDED CONTEXTS.
Combining Large-Scale Structures and Distillation.
Who Sets the Strategy?
Emergent Structure from Application Development.
A Customer-Focused Architecture Team.
Six Essentials for Strategic Design Decision Making.
The Same Goes for the Technical Frameworks.
Beware the Master Plan.
Appendix: The Use of Patterns in This Book.