知识卡片
技术模式入领域须双重解释
经典设计模式原本以技术问题和对象协作为主要动机。只有其中能对应反复出现的领域概念的部分,才适合转为领域模式。使用时需同时解释两层:代码里它如何组织协作;模型里它表达什么业务概念。
原书接下来用 Composite 与 Strategy 说明这种视角转换。不能仅凭代码形状相同,就把技术模式名称写进领域语言;仍需证明领域专家能用该概念解释业务。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Chapter Twelve. Relating Design Patterns to the Model · 查看原书依据
To make use of such patterns in domain-driven design, we have to look at the patterns on two levels simultaneously. On one level, they are technical design patterns in the code. On the other level, they are conceptual patterns in the model.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第87章《Chapter Twelve. Relating Design Patterns to the Model》(源文件:_epub-src/0321125215_ch12.html;单元01)
- 结论依据:原文明确仅部分技术模式可作领域模式,需同时从代码技术结构与模型概念两层理解,后文以Composite和Strategy举例。
- 原始内容:To make use of such patterns in domain-driven design, we have to look at the patterns on two levels simultaneously. On one level, they are technical design patterns in the code. On the other level, they are conceptual patterns in the model.