← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 1831.a.1.c

抽象度衡量构件比例

理解等级:中级

抽象度A=抽象构件数÷(抽象构件数+具体实现构件数),表示接口、抽象类等相对于全部构件的比例。抽象帮助表达整体功能;单个巨大main方法几乎没有这种结构。但抽象度高并非越好,必须与依赖方向配合,才知道接口是否有用而实现是否脆弱。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 选择架构分解方法 · 查看原书依据

      Abstractness is the ratio of abstract artifacts (abstract classes, interfaces, and so on) to concrete artifacts (implementation classes). It represents a measure of abstract versus implementation. Abstract elements are features of a codebase that allow developers to understand the overall function better. For example, a codebase consisting of a single main() method and 10,000 lines of code would score nearly zero on this metric and be quite hard to understand.

    参考来源

    - 位置:《Software Architecture: The Hard Parts》第4章《选择架构分解方法》(来源项目: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/ch04.xhtml) - 结论依据:原文的定义、比较或案例支持“抽象度A=抽象构件数÷(抽象构件数+具体实现构件数),表示接口、抽象类等相对于全部构件的比例”;正文据此解释其用途与适用边界。 - 原始内容:Abstractness is the ratio of abstract artifacts (abstract classes, interfaces, and so on) to concrete artifacts (implementation classes). It represents a measure of abstract versus implementation. Abstract elements are features of a codebase that allow developers to understand the overall function better. For example, a codebase consisting of a single main() method and 10,000 lines of code would score nearly zero on this metric and be quite hard to understand.