知识卡片
全局一致性需为局部模型保留表达空间
大型结构让成员对整体有共同判断,能减少逐个对象层面的重复设计与结果分歧;但局部领域部分可能有更自然的组织方式。作为取舍判断,过度限制的全局规则可能损伤局部表达。
选择结构时应根据真实领域经验,在整体可管理性与局部模型自然表达之间取舍。合适的结构会缩小无效选项,使详细建模更容易;持续重构仍不可省略。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 原书第16章|Evolving Order · 查看原书依据
Of course, continuous refactoring is still necessary, but this will make it a more manageable process and can help make different people come up with consistent solutions.
参考来源
- 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第128章《Evolving Order》(源文件:_epub-src/0321125215_ch16lev1sec1.html;单元01–02)
- 结论依据:原文描述整体可管理性与局部最优结构之间的折中,并指出适合领域的结构可加快细节决策但仍需持续重构。
- 原始内容:Individual parts have natural or useful ways of being organized and expressed that may not apply to the whole, so imposing global rules makes these parts less ideal. Choosing to use a large-scale structure favors manageability of the model as a whole over optimal structuring of the individual parts. Therefore, there will be some compromise between unifying structure and freedom to express individual components in the most natural way. This can be mitigated by selecting the structure based on actual experience and knowledge of the domain and by avoiding over-constrictive structures. A really nice fit of structure to domain and requirements actually makes detailed modeling and design easier, by helping to quickly eliminate a lot of options. [...] Of course, continuous refactoring is still necessary, but this will make it a more manageable process and can help make different people come up with consistent solutions.
- 转录说明:`[...]` 标明关于从对象层面逐个决策的段落省略。