← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 1971.o.1.b.1.a.2.a.1.b.8

隔离核心优先澄清核心而非整理全部外围

理解等级:高级

同一模型元素可能既服务核心领域又承担支持职责,核心类也可能和通用类强耦合,令最重要的关系难以辨认。隔离核心从核心概念出发,把支持元素移到其他对象和包,并提高核心内部内聚性、显化对外围的依赖。

短期内外围“剩余物”可以先留在原处或粗略分包,不必先把所有通用子域都分析完。核心抽取可能拆开原有紧密耦合的元素;判断标准是核心表达是否更清晰,而非每个旧包是否保持原样。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 原书第15章|Segregated Core · 查看原书依据

      Refactor the model to separate the CORE concepts from supporting players (including ill-defined ones) and strengthen the cohesion of the CORE while reducing its coupling to other code. Factor all generic or supporting elements into other objects and place them into other packages, even if this means refactoring the model in ways that separate highly coupled elements.

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第123章《Segregated Core》(源文件:_epub-src/0321125215_ch15lev1sec7.html;单元01) - 结论依据:原文明确以核心为起点提取到独立包,允许外围残余暂时采用简便安排,并承认需拆开紧耦合元素。 - 原始内容:Refactor the model to separate the CORE concepts from supporting players (including ill-defined ones) and strengthen the cohesion of the CORE while reducing its coupling to other code. Factor all generic or supporting elements into other objects and place them into other packages, even if this means refactoring the model in ways that separate highly coupled elements.