UML diagram for the DDD example in Evans' book
基于 Evans 书籍中 DDD 示例的 UML 图
本项目使用 UML 图来展示 Eric Evans 的书籍《Domain-Driven Design: Tackling Complexity in the Heart of Software》中的 DDD 示例——货物运输系统的结构和行为。 这些图是基于 GitHub 上的 dddsample-core 项目的源代码创建的。这些图旨在帮助我们理解该示例如何实现 DDD 的战略和战术设计,以及其运行机制。
如果你想深入了解 DDD 理论,请查看 Evans 的书。如果你想深入了解实现细节,请查看 dddsample-core 项目的源代码。此外,如果你想了解这些图背后的 UML 模型,请使用建模工具 Astah Professional/UML/Viewer 打开模型文件 (ddd-example-in-evans-book.asta)。
点击下面的 UML 图图片,将在 Diagram Map *1 中打开。
*1: Diagram Map 允许您像使用 Google Maps 一样缩放和平移来查看 UML 图。您可以使用任何浏览器查看它。要自己创建一个,需要 Astah Professional/UML 和 m+ plug-in。
用户-系统交互
此序列图说明了用户和系统之间的关键交互,并引用了其他图。
[](https://github.com/takaakit/<https:/takaakit.github.io/uml-diagram-for-ddd-example-in-evans-book/uml_diagram/User-system interaction/diagram_map.html?highlight=0> "User-system interaction")
领域模型概述
此类图说明了领域模型的基本元素及其关系。领域模型元素的布局基于 dddsample-core 项目中提供的图。属性和操作被隐藏,以专注于理解元素及其关系。如果你想看到它们,请使用建模工具 Astah 打开模型文件 (ddd-example-in-evans-book.asta)。
[](https://github.com/takaakit/<https:/takaakit.github.io/uml-diagram-for-ddd-example-in-evans-book/uml_diagram/Domain model overview/diagram_map.html?highlight=0> "Domain model overview")
"ABC123" 货物的领域对象
此对象图显示了基本的领域对象及其连接。特别是,它显示了与货物对象“ABC123”关联的对象快照,该对象预设为示例数据。货物“ABC123”目前正在从香港运往赫尔辛基的途中,目前位于纽约港,卸货已完成。
[](https://github.com/takaakit/<https:/takaakit.github.io/uml-diagram-for-ddd-example-in-evans-book/uml_diagram/Domain objects for ABC123 cargo/diagram_map.html?highlight=0> "Domain objects for ABC123 cargo")
整体结构
此类图说明了货物运输系统的整体结构:它由两个上下文组成,即 Booking context 和 Transport network context。该系统是使用 Spring 项目(例如 Spring Boot / MVC / Data JPA)实现的。请注意,此图侧重于可能被考虑的元素和关系,并不反映整个实现。属性和操作也被隐藏,以专注于理解元素及其关系。如果你想看到它们,请使用建模工具 Astah 打开模型文件 (ddd-example-in-evans-book.asta)。
[](https://github.com/takaakit/<https:/takaakit.github.io/uml-diagram-for-ddd-example-in-evans-book/uml_diagram/Overall structure/diagram_map.html?highlight=0> "Overall structure")
行为 1:初始化
此通信图说明了用户启动货物运输系统的场景,重点关注可能值得考虑的消息。
[](https://github.com/takaakit/<https:/takaakit.github.io/uml-diagram-for-ddd-example-in-evans-book/uml_diagram/Behavior 1 Initialization/diagram_map.html?highlight=0> "Behavior 1: Initialization")
行为 2:货物跟踪
此通信图显示了用户在货物跟踪页面上请求跟踪货物“ABC123”的场景。货物“ABC123”由系统预设,目前正在从香港运往赫尔辛基的途中,目前位于纽约港,卸货已完成。
[](https://github.com/takaakit/<https:/takaakit.github.io/uml-diagram-for-ddd-example-in-evans-book/uml_diagram/Behavior 2 Cargo tracking/diagram_map.html?highlight=0> "Behavior 2: Cargo tracking")
行为 3-1:货物预订
此通信图显示了用户在货物预订页面上注册新货物的场景。新货物设置为从纽约运往赫尔辛基。
[](https://github.com/takaakit/<https:/takaakit.github.io/uml-diagram-for-ddd-example-in-evans-book/uml_diagram/Behavior 3-1 Cargo booking/diagram_map.html?highlight=0> "Behavior 3-1: Cargo booking")
行为 3-2:路线建议
此通信图说明了用户在货物预订结果页面上请求货物路由,然后显示路线候选方案的场景。
[](https://github.com/takaakit/<https:/takaakit.github.io/uml-diagram-for-ddd-example-in-evans-book/uml_diagram/Behavior 3-2 Route suggestion/diagram_map.html?highlight=0> "Behavior 3-2: Route suggestion")
行为 3-3:路线分配
此通信图说明了用户请求在路线选择页面上将新货物分配给交付路线的场景。
[](https://github.com/takaakit/<https:/takaakit.github.io/uml-diagram-for-ddd-example-in-evans-book/uml_diagram/Behavior 3-3 Route assignment/diagram_map.html?highlight=0> "Behavior 3-3: Route assignment")
额外内容:有向图
这是一个有向图 *2,表示与 Booking context 和 Transport network context 相关的结构元素及其关系。此图允许您以各种布局查看元素关系。
*2: 要自己创建此有向图,需要 Astah Professional/UML 和 m+ plug-in。
参考文献
- Evans, Eric. Domain-Driven Design: Tackling Complexity in the Heart of Software, Addison-Wesley, 2004.
- Evans, Eric. Domain-Driven design Reference: Definitions and pattern summaries. Dog Ear Publishing, 2014.
链接
- citerus/dddsample-core @GitHub
- Astah Professional/UML/Viewer 下载页面
- m+ plug-in 下载页面
许可证
Diagram map (diagram_map.html) 和 Directed graph (directed_graph.html) 包含以下库:
- D3.js 的版权归 Mike Bostock 所有,并根据 BSD license 发布。
- Popper.js 的版权归 Federico Zivolo 所有,并根据 MIT license 发布。
- Tippy.js 的版权归 atomiks 所有,并根据 MIT license 发布。
- Chroma.js 的版权归 Gregor Aisch 所有,并根据 BSD license 发布。
- Three.js 的版权归 three.js 作者所有,并根据 MIT license 发布。
- Vanta.js 的版权归 Teng Bao 所有,并根据 MIT license 发布。
本项目中除上述库之外的文件和数据均采用 Creative Commons Zero (CC0) license。
发现错误?
如果你在图或模型中发现任何错误,请打开一个 issue。
关于
UML diagram for the DDD example—a cargo shipping system—from Eric Evans' book takaakit.github.io/uml-diagram-for-ddd-example-in-evans-book/