知识卡片

普通读书笔记卡 · 3282

松耦合降低替换成本

理解等级:中级

松耦合要求组件关联可拆解,且尽量不了解彼此内部定义。只要保留约定的服务能力,提供方就能替换实现或技术栈,使用方也较易测试、替换依赖;若接口泄露内部类型,这种自由会迅速缩小。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      A loosely coupled system has two properties. First, components are weakly associated (have breakable relationships) with each other, which means that changes in one component do not affect the functionality or performance of another component. And second, each of the system’s components has little or no knowledge of the definitions of other separate components. Components in a loosely coupled system can be replaced with alternative

    参考来源

    - 位置:《Mastering API Architecture》第8章《Redesigning Applications to API-Driven Architectures》之《Clarifying Domain Boundaries: Promoting Loose Coupling》(源文件:_epub-src/OEBPS/ch08.xhtml) - 结论依据:原文给出弱关联和少知内部定义两项条件,并指出实现替换与提供、消费双方的收益。 - 原始内容:A loosely coupled system has two properties. First, components are weakly associated (have breakable relationships) with each other, which means that changes in one component do not affect the functionality or performance of another component. And second, each of the system’s components has little or no knowledge of the definitions of other separate components. Components in a loosely coupled system can be replaced with alternative