Files
nexus/wiki/concepts/DomainDrivenDesign.md
2026-05-03 05:42:12 +08:00

33 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Domain-Driven Design"
type: concept
tags: []
last_updated: 2026-05-01
---
## Definition
一种以业务领域为核心的软件设计方法论通过建立通用语言Ubiquitous Language在技术和业务团队之间建立统一的沟通模型并以有界上下文Bounded Context划分系统的边界。
## Key Patterns
- **Bounded Context**:业务领域的清晰边界,每个上下文有独立的模型和术语
- **Aggregate**:聚合根,负责维护业务不变量
- **Domain Event**:领域事件,记录业务状态变化
- **Anti-Corruption Layer**:防腐层,隔离外部系统对核心域的侵蚀
- **Context Mapping**上下文映射定义不同有界上下文之间的关系Upstream/Downstream/Conformist/Anti-Corruption
## Core Principles
- **领域优先,技术其次**:先理解业务问题,再选择技术实现
- **通用语言**:团队中的每个人都使用同一套术语,减少沟通摩擦
- **持续精化**:领域模型通过迭代不断深化对业务的理解
## Related Concepts
- [[BoundedContext]]DDD 中的核心边界概念
- [[EventStorming]]:领域发现的协作技术
## Sources
- [[engineering-software-architect]]
## Aliases
- DDD
- Domain-Driven Design