Ddd evans 2003

From curiositech/windags-skills · View interactive version

Ddd evans 2003 is an AI agent skill from the GitHub repository curiositech/windags-skills. Domain-Driven Design methodology using bounded contexts, ubiquitous language, and strategic/tactical patterns

How to use this skill

Skill file

Domain-Driven Design (Eric Evans)

Strategic and tactical patterns for building software systems that remain aligned with business reality as complexity grows.

Decision Points

Language & Naming Conflicts

Is the same word used differently across teams/systems?
├── Yes → Explicit Bounded Context boundary needed
│   ├── Teams can coordinate? → Shared Kernel or Customer/Supplier
│   └── Teams independent? → Anti-Corruption Layer
└── No → Can use single Ubiquitous Language
    ├── Code names ≠ domain expert names? → Rename code to match domain
    └── Names match → Continue with current language

Object Identity & Boundaries

Does the business care which specific instance this is?
├── Yes → Entity
│   ├── Multiple entities modified together for consistency? → Same Aggregate
│   └── Independent lifecycle? → Separate Aggregates  
└── No → Value Object
    ├── Immutable attributes only? → Pure Value Object
    └── Contains behavior? → Value Object with methods

Strategic Investment

Is this subdomain where we create competitive advantage?
├── Yes → Core Domain
│   ├── Complex business rules? → Deep modeling with tactical patterns
│   └── Simple CRUD? → May not be truly Core
└── No → Generic/Supporting Subdomain
    ├── Commodity problem? → Buy or use off-shelf solution
    └── Organization-specific? → Minimal custom solution

Failure Modes

**Anemic Domain Model**

**Translation Tunnel**

**God Aggregate**

**Shallow Metaphor Lock-in**

**One Model Delusion**

Worked Examples

E-Commerce Context Splitting

Scenario: Single "Product" concept causing integration pain between catalog and inventory teams.

Analysis Walk-through:

  1. Identify the conflict: Catalog team needs rich attributes (descriptions, categories, SEO); Inventory team needs quantities, locations, reservations
  2. Map current usage: Same Product class being modified by both teams for different reasons
  3. Decision point: Is this one concept or two? Business says "it's the same product" but they mean different things
  4. Context boundary: Catalog Context (ProductDetails) vs Inventory Context (StockItem)
  5. Integration choice: Customer/Supplier relationship - Inventory subscribes to catalog events for new products

Expert insight: Novice focuses on avoiding duplication; expert focuses on model integrity within each context.

Payment Processing Aggregate Design

Scenario: Designing order processing where payment, shipping, and inventory must stay consistent.

Analysis Walk-through:

  1. Identity question: Does business care about specific Order instance? Yes → Entity
  2. Consistency boundary: Payment + OrderLines must change together (inventory reserved when payment succeeds)
  3. Aggregate scope: Order (root) + OrderLines + Payment attempt, but NOT inventory records (different lifecycle)
  4. Repository design: OrderRepository loads entire aggregate; InventoryService handles stock via domain events
  5. Concurrency: Optimistic locking on Order aggregate; inventory conflicts handled via compensating actions

Expert insight: Novice includes everything "related"; expert includes only what needs transactional consistency.

Quality Gates

NOT-FOR Boundaries

Don't use DDD for:

Delegate to other skills:

Context boundaries:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.