nw-ddd-tactical

Featured

Tactical DDD — aggregate design rules, entities, value objects, domain events, repositories, domain services, and anti-pattern detection

AI & Automation 636 stars 68 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
93
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Tactical DDD Implementation patterns within a bounded context. Tactical DDD answers: "How do we structure the domain model?" ## Aggregates An aggregate is a consistency boundary -- a cluster of domain objects that must be transactionally consistent. ### Vernon's Four Design Rules 1. **Model true invariants in consistency boundaries**: Only include elements that MUST be consistent within the same transaction. If two entities don't share an invariant, they belong in separate aggregates. 2. **Design small aggregates**: ~70% of aggregates contain only a root entity with value-typed properties. Large aggregates create concurrency contention, scalability failures, and memory pressure. 3. **Reference other aggregates by identity**: Use `ProductId` not `Product`. Direct object references create accidental cross-aggregate transactions and prevent independent scaling. 4. **Use eventual consistency outside the boundary**: Domain events communicate across aggregates. One transaction = one aggregate. If you need to update two aggregates "atomically," reconsider your boundaries. ### Aggregate Design Checklist - [ ] Contains only elements sharing true invariants - [ ] Root entity controls all access (no direct child manipulation) - [ ] External references by ID only (no object graphs) - [ ] Small enough for single-transaction performance - [ ] Command produces events (in event-sourced systems) or mutates state (in traditional) - [ ] Business rules validated in command handling, ...

Details

Author
nWave-ai
Repository
nWave-ai/nWave
Created
9 months ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

ddd-tactical-design

Use when implementing domain logic, designing aggregates, entities, value objects, repositories, domain services, domain model design, ensuring data consistency, or when user mentions 'aggregate design', 'aggregate root', 'entity vs value object', 'domain event', 'repository pattern', 'domain service', 'data consistency', 'invariant protection', 'domain model', 'business rules', 'consistency boundary', 'rich domain model', 'anemic domain model', '领域模型', '领域逻辑', '业务逻辑', '聚合设计', '聚合根', '实体', '值对象', '业务规则', '一致性边界', '充血模型', '贫血模型', '实现领域代码'.

6 Updated 4 months ago
konglong87
AI & Automation Listed

ddd

Domain-Driven Design patterns for .NET — aggregates, value objects, strongly-typed IDs, domain events, repositories, and layer rules.

5 Updated yesterday
zdanovichnick
Web & Frontend Listed

ddd-guide

Use when finding and naming domain boundaries and modelling inside them: establishing a ubiquitous language, drawing bounded contexts and a context map, protecting a model with an anti-corruption layer, and applying the tactical building blocks (entity, value object, aggregate + root, domain event, repository, domain/application service). Triggers on ubiquitous language, bounded context, context map, anti-corruption layer, aggregate / aggregate root, entity vs value object, domain event, repository, strategic vs tactical design, anemic domain model, even when the user doesn't say 'DDD'.

6 Updated 1 weeks ago
xonovex