Tactical DDD (just better OOP?) - PHPBenelux 2017
- 4. STRATEGIC DDD
The big picture
Ubiquitous language
Domain and subdomains
Bounded contexts
Context mapping
Collaboration
Discovery
- 7. DDD
Scaling your domain model
Keep it consistent
Keep it manageable
Make it perform well
Ubiquitous language
Bounded contexts
Aggregates
- 8. ENTITIES
Change & identity
Identity
Provided by user, application or persistence mechanism
Repository encapsulates identity generation
Surrogate identity
Mutability & individuality
Validation & consistency (encapsulation)
- 9. ENTITIES
Checklist
Does the object need to be retrieved from a repository by its
unique identity?
Does the object need to track changes?
Are two instances equivalent if they have the same identity?
- 11. VALUE OBJECTS
Checklist
Is it irrelevant which exact instance of the object is used?
Can the object be replaced, instead of modified?
Are two objects of the same type equal if their properties
contain equal values?
- 14. “When examining the use case (or
story), ask whether it's the job of the
user executing the use case to make
the data consistent.
- 16. AGGREGATES
Implementation
Root entity with unique identity
Favor value object parts
Use Law of Demeter and Tell, Don't Ask
Optimistic concurrency
Avoid dependency injection and references to static services