← 返回起始笔记位置

知识卡片

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

向心与离心耦合描述依赖方向

理解等级:中级

把代码制品看作依赖图中的节点,向心耦合(Ca)数指向该节点的连接,离心耦合(Ce)数它指向别处的连接。前者说明多少地方依赖它,后者说明它依赖多少外部部分。

例如甲调用乙:对乙计一条向心连接,对甲计一条离心连接。这个例子是教学演示,不是原书实测。计数揭示连接方向,仍需回读调用的语义与变更影响,不能仅凭数量判定好坏。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • Modularity · 查看原书依据

      Afferent coupling measures the number of incoming connections to a code artifact (component, class, function, and so on). Efferent coupling measures the outgoing connections to other code artifacts.

    参考来源

    - 位置:《Fundamentals of Software Architecture》第05章《Modularity》(源文件:`OEBPS/ch03.html`,Coupling) - 结论依据:原文定义 afferent/efferent 为代码制品的入边/出边,并说明可用调用图分析;甲乙例子与最后的解释边界为教学推断。 - 原始内容:Afferent coupling measures the number of incoming connections to a code artifact (component, class, function, and so on). Efferent coupling measures the outgoing connections to other code artifacts.