知识卡片

普通读书笔记卡 · 1876.a.2

共享库也引入耦合

理解等级:中级

库减少重复实现,同时把消费者连接到同一个变化点。小修改也可能要求多栈复测,破坏性需求还可能逼所有用户迁移。选择扩展既有库还是创建新组件,要比较知识复用收益与跨使用场景协调成本,不能只用减少代码行数衡量。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 基础设施组件 · 查看原书依据

      Code libraries are a common solution for reducing duplicated code across infrastructure stack projects. However, sharing a library across stacks is a trade-off between reuse and coupling. Making a change to a library impacts all the stacks that use it. A simple change may require all the library’s users to retest their components and systems

    参考来源

    - 位置:《Infrastructure As Code》第6章《基础设施组件》(来源项目 book-sources,源文件:extracted/Infrastructure As Code/_epub-src/OEBPS/ch06.html) - 结论依据:原文对该概念的定义、应用条件与作用机制直接支持上述解释。 - 原始内容:Code libraries are a common solution for reducing duplicated code across infrastructure stack projects. However, sharing a library across stacks is a trade-off between reuse and coupling. Making a change to a library impacts all the stacks that use it. A simple change may require all the library’s users to retest their components and systems