知识卡片
依赖只引入实际所需
新增库或功能时应逐项选择真正使用的依赖,查看传递依赖图,并在评审中核对依赖变化。直接复制现成配置文件会把无关库和版本冲突带进项目。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 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.