知识卡片

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

组织图后来收回机制仍保留声明式接口

理解等级:高级

原书组织图项目完成约一年后,其他开发者认为独立图框架带来的对象数和包分隔不合算,把节点行为并入组织实体的父类。实际重构结果仍保留组织模型的声明式公开接口,机制也继续封装在实体内部。

所以“分离后又合回去”不等于回到原点:中间阶段帮助团队识别事实、目标与机制,后来可删去多余结构,同时留下清晰接口与封装。是否保持单独框架取决于当时的复杂度收益。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 原书第15章|Cohesive Mechanisms · 查看原书依据

      Actually, a year after we completed the organization model in the previous example, other developers redesigned it to eliminate the separation of the graph framework. They felt the increased object count and the complication of separating the MECHANISM into a separate package were not warranted. Instead, they added node behavior to the parent class of the organizational ENTITIES. Still, they retained the declarative public interface of the organization model. They even kept the MECHANISM encapsulated, within the organizational ENTITIES. These full circles are common, but they do not return to their starting point. The end result is usually a deeper model that more clearly differentiates facts, goals, and MECHANISMS. Pragmatic refactoring retains the important virtues of the intermediate stages while shedding the unneeded complications.

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第122章《Cohesive Mechanisms》(源文件:_epub-src/0321125215_ch15lev1sec6.html;单元03) - 结论依据:原文记录组织图框架一年后被收回实体父类,并明确保留声明式接口和内部封装。 - 原始内容:Actually, a year after we completed the organization model in the previous example, other developers redesigned it to eliminate the separation of the graph framework. They felt the increased object count and the complication of separating the MECHANISM into a separate package were not warranted. Instead, they added node behavior to the parent class of the organizational ENTITIES. Still, they retained the declarative public interface of the organization model. They even kept the MECHANISM encapsulated, within the organizational ENTITIES. These full circles are common, but they do not return to their starting point. The end result is usually a deeper model that more clearly differentiates facts, goals, and MECHANISMS. Pragmatic refactoring retains the important virtues of the intermediate stages while shedding the unneeded complications. - 转录说明:原 EPUB 强调标签边界造成的术语前空格已规范转录;“usually”是作者一般观察,卡片实际结果仅指组织图项目保留接口和内部封装。