nw-ddd-tactical

仓库创建 2026年2月13日最近提交 1 个月前SkillHot 收录 22 天前
▸ 精选理由

提供具体设计规则,帮助开发者构建一致的领域模型。

这个 Skill 做什么

领域战术设计规则:聚合、实体、事件与反模式检查。

教你如何把领域模型拆成聚合(aggregate)、实体、值对象、领域事件和仓库,明确一致性边界和事务边界,适合在建模或实现领域逻辑时用。给出可执行的设计规则和常见反模式提示,帮你识别哪些对象必须放在同一个聚合、哪些应该分离。目标是把复杂业务拆成可维护、可验证的小单元。

▸ 展开 SKILL.md 英文原文

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

开发编程战术DDD聚合设计反模式通用
586
Stars
59
Forks
40
仓库内 Skill
+16
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/nWave-ai/nWave/main/nWave/skills/nw-ddd-tactical/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/nWave-ai/nWave/main/nWave/skills/nw-ddd-tactical/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# 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. 
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有