3. Agenda
• What is Domain Driven Design?
• Strategic patterns
• Tactical patterns
• Toolkit
3
4. What is Domain Driven Design (DDD)
• Not a technology or methodology
• Set of principles & patterns for focusing the design effort where it matters
most
• It’s all about:
• Understanding of the domain (subject area) where the software will be applied
• Creating a highly expressive model of that domain
• Distilling “Ubiquitous Language”
• Prerequisite: on-going collaboration between developers + domain experts
• When to apply: complex problems, high expectations
4
9. Value Objects vs Entities
Entities:
Objects with an identity and a state
State evolves as long as application lives
Generally with a DB counterpart
Identifier Equality
9
Value Objects:
Have no conceptual identity
Can be designed as immutable
Can be shared between different entities
Structural Equality
11. Example, part 1 (Alberto Brandolini)
User Story 1:
As a Customer
I want to place an order
In order to purchase some goods
11
12. Example, part 2 (Alberto Brandolini)
User story 2, Returning
Customer:
As a customer
I want to retrieve my profile
in order to place more orders
12
13. Example, part 3 (Alberto Brandolini)
User story 3, Different
shipping address:
As a customer
I want to specify a valid
shipping address
In order to ship to a different
destination
13
14. Example, part 4 (Alberto Brandolini)
User story 4, Editable
customer profile:
As a customer
I want to edit my profile
In order to update it if
needed
14
15. Example, part 5 (Alberto Brandolini)
User story 5, Specify Billing
and Shipping Address:
As a customer
I want to specify
independent billing and
shipping addresses
In order to deliver goods to
different locations
15
16. Example, part 6 (Alberto Brandolini)
User story 6, Track past
orders:
As a Legal Department
I want to track orders
In order to manage
litigations
16