What problem does it solve?
Domain-Driven Design (DDD) helps you model complex business rules by defining clear consistency boundaries, expressing domain concepts as validated value objects, and using domain events to decouple side effects from core invariants.
Core Features & Use Cases
- Aggregates for consistency boundaries: Enforce invariants within an aggregate in a single transaction while allowing eventual consistency across aggregates.
- Value Objects over primitives: Replace primitive obsession with immutable, validated C# record value objects for correct equality and behavior.
- Domain events for meaningful state changes: Raise domain events inside aggregates and handle side effects after persistence to keep the domain model focused.
- Aggregate root as the single entry point: Ensure external code can only interact through the root entity to maintain rules and prevent invalid states.
- Repository per aggregate root: Persist aggregates as a whole (not child entities) using a repository boundary for aggregate persistence.
Quick Start
Load the ddd skill when implementing DDD for a .NET domain and design an aggregate root with validated value objects and domain events to represent your business workflow.