<< All versions

Skill v1.0.0

currentAutomated scan100/100
danielpohlmann/ia-marktplace/dev-architecture-domain-driven-design
──Details
PublishedOctober 25, 2026 at 04:52 AM
Content Hashsha256:ab4e01a508001e27...
Git SHA9f1dda3738fd
──Files
Files (1 file, 4.0 KB)
SKILL.md4.0 KBactive
SKILL.md · 62 lines · 4.0 KB

version: "1.0.0" name: dev-architecture-domain-driven-design description: Use when modeling a complex domain with DDD. USE FOR: bounded contexts, context maps, subdomain classification, ubiquitous language, aggregates, entities, value objects, domain services, repositories. DO NOT USE FOR: event sourcing mechanics (use dev-architecture-event-driven), service decomposition (use dev-architecture-microservices), ports/adapters (use dev-architecture-hexagonal).


Domain-Driven Design (DDD)

Overview

Domain-Driven Design is a software design approach that centers the development process on the core business domain. It provides both strategic patterns for organizing large systems and tactical patterns for modeling individual domains. DDD is especially valuable for complex domains where the business logic is the primary source of difficulty.

The canonical reference is Eric Evans' Domain-Driven Design: Tackling Complexity in the Heart of Software (2003), supplemented by Vaughn Vernon's Implementing Domain-Driven Design (2013) and Domain-Driven Design Distilled (2016).

Core premise: The structure of the software should mirror the structure of the business domain. The language used by developers should be the same language used by domain experts.

Strategic + Tactical DDD Together

Strategic (System Level):
Identify Subdomains → Define Bounded Contexts → Map Context Relationships
Tactical (Within Each Context):
Model Aggregates → Define Entities & Value Objects →
Publish Domain Events → Implement Repositories & Services

Common DDD Anti-Patterns

Anti-PatternProblemSolution
Anemic Domain ModelEntities are just data bags; logic lives in servicesMove behavior into entities and value objects
God AggregateOne massive aggregate with many entitiesBreak into smaller aggregates; use eventual consistency
Shared Database across ContextsBounded contexts lose independenceEach context owns its data; integrate through events or APIs
Ubiquitous Language mismatchCode uses different terms than domain expertsRefactor code to match the domain language exactly
DDD everywhereApplying DDD to simple CRUD domainsUse DDD for core subdomains; use simpler approaches for generic/supporting

Best Practices

  • Apply DDD only where the domain complexity justifies it (core subdomains). For CRUD-heavy generic subdomains, simpler approaches are fine.
  • Invest heavily in ubiquitous language. If developers and domain experts use different words, the design will drift.
  • Keep aggregates small. The default should be a single entity as the aggregate root. Add more only when invariants require it.
  • Reference other aggregates by identity, never by direct object reference.
  • Use domain events for cross-aggregate and cross-context communication.
  • Collaborate with domain experts continuously -- DDD is not a solo developer activity.
  • Draw context maps early and revisit them as the system evolves.
  • Bounded context boundaries often align well with microservice boundaries (see dev-architecture-microservices), but they don't have to -- a modular monolith can also respect bounded contexts (see dev-architecture-monoliths).

Detailed reference

Load only the file that matches the task — each is self-contained.

FileContents
references/strategic-ddd.mdStrategic DDD — Ubiquitous Language, Bounded Contexts, Subdomains, Context Maps, Context Mapping Patterns
references/tactical-ddd.mdTactical DDD — Entities, Value Objects, Aggregates and Aggregate Roots, Aggregate Design Rules, Aggregate Design Example, Domain Events, …

References

See references/rules.md for the full rule catalog.

All versions