知识卡片

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

隔离核心按识别迁移剥离精炼循环推进

理解等级:高级

原书给出的典型步骤:

  1. 识别一个核心子域,可参考提炼文档。
  2. 把相关类移入以概念命名的新模块。
  3. 将非该概念的资料与功能剥离到其他包,让核心对外引用明确且能说明意图。
  4. 持续简化核心模块内部关系,并减少、澄清与外部模块的耦合。
  5. 对下一个核心子域重复。

第3步不必把外围安置做到完美;第4步也不是一次完成的收尾动作。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

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

      Refactor code to sever data and functionality that are not directly expressions of the concept. Put the removed aspects into (possibly new) classes in other packages. Try to place them with conceptually related tasks, but don't waste too much time being perfect. Keep focused on scrubbing the CORE subdomain and making the references from it to other packages explicit and self-explanatory. Refactor the newly SEGREGATED CORE MODULE to make its relationships and interactions simpler and more communicative, and to minimize and clarify its relationships with other MODULES. (This becomes an ongoing refactoring objective.) Repeat with another CORE subdomain until the SEGREGATED CORE is complete.

    参考来源

    - 位置:《Domain-Driven Design: Tackling Complexity in the Heart of Software》第123章《Segregated Core》(源文件:_epub-src/0321125215_ch15lev1sec7.html;单元01) - 结论依据:原文列出五步,并特别强调外围放置不要耗费过多时间、核心模块关系改进是持续目标。 - 原始内容:Refactor code to sever data and functionality that are not directly expressions of the concept. Put the removed aspects into (possibly new) classes in other packages. Try to place them with conceptually related tasks, but don't waste too much time being perfect. Keep focused on scrubbing the CORE subdomain and making the references from it to other packages explicit and self-explanatory. Refactor the newly SEGREGATED CORE MODULE to make its relationships and interactions simpler and more communicative, and to minimize and clarify its relationships with other MODULES. (This becomes an ongoing refactoring objective.) Repeat with another CORE subdomain until the SEGREGATED CORE is complete. - 转录说明:所引第3–5步在原 EPUB 列表中相邻,未省去正文;卡片五步依原文顺序重述,不将外围临时安置写成最终结构。