知识卡片
责任层按领域概念依赖组织宽泛职责
普通技术分层即使让依赖方向清楚,也未必说明每层在领域中负责什么。责任层从领域的自然分层出发:寻找概念依赖、不同变化速度与变化来源,把宽泛职责命名为能讲述业务大图景的层,再让对象、聚合和模块落入相应职责。
上层可使用任一较低层,不必只调用紧邻层;低层概念应能独立成立。其价值是让团队凭层名理解设计,而不只是机械限制调用方向。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第16章|Responsibility Layers · 查看原书依据
Look at the conceptual dependencies in your model and the varying rates and sources of change of different parts of your domain. If you identify natural strata in the domain, cast them as broad abstract responsibilities. These responsibilities should tell a story of the high-level purpose and design of your system. Refactor the model so that the responsibilities of each domain object, AGGREGATE, and MODULE fit neatly within the responsibility of one layer.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第130章《Responsibility Layers》(源文件:_epub-src/0321125215_ch16lev1sec3.html;单元01、04)
- 结论依据:原文把自然分层、概念依赖和变化来源作为抽取依据,并指出采用可访问任意下层的松弛分层变体。
- 原始内容:Look at the conceptual dependencies in your model and the varying rates and sources of change of different parts of your domain. If you identify natural strata in the domain, cast them as broad abstract responsibilities. These responsibilities should tell a story of the high-level purpose and design of your system. Refactor the model so that the responsibilities of each domain object, AGGREGATE , and MODULE fit neatly within the responsibility of one layer.