← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 3333.l.1.a.2

共享源码也须明确归属

理解等级:中级

共享接口、抽象类和工具类放在领域根目录,仍属孤儿类,应移入专门叶组件。使用统一且不与业务混淆的sharedcode等命名,可统计共享组件数量和共享语句占比:前者提示潜在共享库或服务数量,后者提示拆分后依赖维护负担。共享占比高是风险线索,不是固定比例的失败判决。

相关:[[叶节点界定组件]]。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 基于组件的分解模式 · 查看原书依据

      Our advice when moving shared code to a separate component (leaf node namespace) is to pick a word that is not used in any existing codebase in the domain, such as .sharedcode, .commoncode, or some such unique name. This allows the architect to generate metrics based on the number of shared components in the codebase, as well as the percentage of source code that is shared in the application.

    参考来源

    - 位置:《Software Architecture: The Hard Parts》第5章《基于组件的分解模式》(来源项目:book-sources;源文件:extracted/Software Architecture The Hard Parts Modern Trade-Off Analyses for Distributed Architectures (Neal Ford, Mark Richards, Pramod Sadalage etc.)/_epub-src/OEBPS/ch05.xhtml) - 结论依据:原文的定义、比较或案例支持“共享接口、抽象类和工具类放在领域根目录,仍属孤儿类,应移入专门叶组件”;正文据此解释其用途与适用边界。 - 原始内容:Our advice when moving shared code to a separate component (leaf node namespace) is to pick a word that is not used in any existing codebase in the domain, such as .sharedcode, .commoncode, or some such unique name. This allows the architect to generate metrics based on the number of shared components in the codebase, as well as the percentage of source code that is shared in the application.