Key concepts
- Entity — an object with unique identity (User, Order)
- Value Object — an object without identity; equality is by value (Money, Email)
- Aggregate — a cluster of objects with one root (Order + OrderItems)
- Repository — an abstraction for storing aggregates
- Domain Event — an event that occurred in the domain (
OrderPlaced) - Bounded Context — a boundary within which the model and language have unambiguous meaning
When justified
DDD adds complexity. It is justified for complex domains with rich business logic. For simple CRUD applications — overkill.