知识卡片

普通读书笔记卡 · 3328.a

高耦合源于越界依赖

理解等级:高级

高耦合是组件依赖了本不该暴露的内部细节,导致局部改动出现难以预测的连锁影响。单体代码集中使直接调用内部方法很方便,却可能绕开职责与契约检查。诊断时应追踪具体越界依赖及变更传播路径,再决定是否需要重新划界;单体形式本身不足以证明高耦合。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Principles of Software Architecture Modernization》第1章《What’s Wrong with Monoliths?》(源文件:`_epub-src/OPS/ch01.xhtml`,归一化正文 [20775:24977)) - 结论依据:原文把不必要的组件耦合称为高耦合,并说明缺少边界与缓慢变化的契约会使改动产生意外影响;单体中访问内部方法的便利是促成机制。 - 原始内容:When you fail to limit those boundaries - to have clearly defined, slow-moving contracts guiding communication and action - changing components can have terrible, unexpected effects. When components are unnecessarily coupled to one another, we call that phenomenon “high coupling”, and Monoliths are a perfect playground to create a nightmare of high coupling. Monoliths create many temptations and lures that can lead a team towards high coupling – see Figure 1.5 for an overview.