知识卡片
抽象度与不稳定度描述结构位置
原书用两个比率概括面向对象代码制品的结构:
| 指标 | 计算 | 读法 |
|---|---|---|
| 抽象度 A | 抽象制品数 ÷(抽象制品数+具体制品数) | 越接近1,抽象占比越高 |
| 不稳定度 I | 离心耦合 Ce ÷(Ce+向心耦合 Ca) | 越接近1,对外依赖的相对比例越高 |
这两个指标量的是结构,不直接量业务正确性。分母为零时该比率不能按公式计算;判读时先确认统计单位和工具口径,再看具体依赖关系。后两句是计算边界与应用推断。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Modularity · 查看原书依据
Architects calculate Abstractness by calculating the ratio of the sum of abstract artifacts to the sum of the concrete and abstract ones.
参考来源
- 位置:《Fundamentals of Software Architecture》第05章《Modularity》(源文件:`OEBPS/ch03.html`,Core Metrics,公式3-3、3-4)
- 结论依据:原文明确两个比率的分子分母及 Ce/Ca 的含义;零分母和统计口径是据公式推得的使用边界。
- 原始内容:Architects calculate Abstractness by calculating the ratio of the sum of abstract artifacts to the sum of the concrete and abstract ones.