An Introduction to Domain Driven Design focusing on the concepts of Bounded Context, Strategic & Tactical Design, CQRS, Ubiquitous Language, Hexagonal Architecture, Event Sourcing, Task - based UIs
8. 8
DDD Alternative
Monolithic Data Models (Big
Ball of Mud)
Anemic Data Models
Relational-Database way of
thinking
Communication Difficulties
Smaller Independent Domain
Models / Integration
Rich Behavior Objects (OOP
done right)
Persistence Ignorance
Ubiquitous Language
10. 10
What is DDD?
It is an Approach to develop software for
- Complex needs
- Evolving models
It is Not a technology or a methodology
It is a Way of Thinking
11. 11
Brief History of DDD
Eric Evans – 2003
DDD Community (http:// www.domaindrivendesign.org)
Jimmy Nilson – 2006
Greg Young – 2008 / 2013
Vaughn Vernon – 2013
P:PubTechnical_documentationDomain Driven Design (DDD)
12. 12
The Business Value of DDD
1. The organization gains a useful model of its domain.
2. A refined, precise definition and understanding of the business is developed.
3. Domain experts contribute to software design.
4. A better user experience is gained.
5. Clean boundaries are placed around pure models.
6. Enterprise architecture is better organized.
7. Agile, iterative, continuous modeling is used.
8. New tools, both strategic and tactical, are employed.
27. 27
Domain Model (Solution Space)
A system of abstractions that:
•Describes selected aspects of a domain and
•Can be used to solve problems related to that domain.
30. 30
Bounded Context
A description of a boundary (typically a subsystem, or the work of
a particular team) within which a particular model is defined and
applicable.
32. 32
Ubiquitous Language
A language structured around the domain model.
Used by all team members, within a bounded context, to connect
all the activities of the team with the software.
NOT universal!
33. 33
Ubiquitous Language - An Example
Requirements for “Customer”
•Change Personal Name
•Set Postal Address
•Relocate to Postal Address
•Change Home Telephone
•Disconnect Home Telephone
•Set Primary Email Address
•Set Secondary Email Address
47. 9/12/2013 47
Loose Coupling and High Cohesion
Decrease Coupling
Increase Cohesion
Eliminate Inappropriate Intimacy
The Law of Demeter
Tell, Don’t Ask
Say it Once and Only Once
75. 75
Wrap-Up: Strategy
•In certain cases, one Model cannot make it
•Multiple Models – Integration with Strategic Design
•Ubiquitous Language in Model, Code, Spoken & Written Language
•Be a Good Listener – Understand the Problem Space
•The “worst” Domain Expert is the Best in the World compared to us
•The obvious is not adequate. Focus on Exceptions
•How would / does the Domain function Without Computers?
•Initial Analysis and Design are Not Dogmas – Knowledge comes Slowly
Redesign
76. 76
Wrap-Up: Tactics
•Model-Driven Design as OOP done right
•Focus on What instead of How
•Focus on Behavior (hidden in Verbs) instead of Data (hidden in Nouns)
•Be familiar with, Design Patterns and Principles
•Command Query Responsibility Segregation
•Event – Driven Architecture
•Event Stores
•Hexagonal Architecture / Ports & Adapters
Refactor
77. 77
Strategic, Tactical, DDD, OOP, CQRS, UI, ES, EDA, ….
For the things we have to learn before we can do them,
we learn by doing them.
Aristotle