知识卡片

普通读书笔记卡 · 3382

依赖只引入实际所需

理解等级:中级

新增库或功能时应逐项选择真正使用的依赖,查看传递依赖图,并在评审中核对依赖变化。直接复制现成配置文件会把无关库和版本冲突带进项目。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    原书出处

    参考来源

    - 位置:《Principles of Software Architecture Modernization》第4章《Anti-Patterns: Internal Shared Libraries》(源文件:`_epub-src/OPS/ch04.xhtml`,归一化正文 [79659:83838)) - 结论依据:原文建议精确挑选依赖,指出复制其他项目的 pom.xml 会引入许多无关项。 - 原始内容:And while you are cherry-picking only the libraries you need, make sure you understand what dependencies those libraries will bring to your classpath.