知识卡片
非对象范式按边界引入
领域模型可以用对象之外的范式表达:全局逻辑推理或高度数学化的部分,未必适合拆成封装行为的对象。若非对象部分与主体依赖少,可将其封装为可调用的子系统;若主体本身更适合另一范式,甚至应重新考虑主技术平台。规则、工作流等组件与对象紧密交织时,混合工具会增加模型一致性和集成难度,不能只因局部表达更自然就引入。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第05章|Modeling Paradigms · 查看原书依据
When the interdependence is small, a subsystem in the other paradigm can be encapsulated, such as a complex math calculation that simply needs to be called by an object.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第42章《原书第05章|Modeling Paradigms》(源文件:_epub-src/0321125215_ch05lev1sec6.html)
- 结论依据:原文对比数学或逻辑领域与对象范式,按异类部分的占比和相互依赖程度区分封装、切换范式及混合范式的取舍。
- 原始内容:For example, domains that are intensely mathematical or that are dominated by global logical reasoning do not fit well into the object-oriented paradigm. ... When the interdependence is small, a subsystem in the other paradigm can be encapsulated, such as a complex math calculation that simply needs to be called by an object. ... But making a coherent model that spans paradigms is hard, and making the supporting tools coexist is complicated.