知识卡片
未复用模块可能多余
仅在一个栈中使用的模块,常只是组织文件的手段,却引入版本和依赖管理。若能独立测试它,模块化可能有益;否则可用文件和目录改善导航,或把过大的栈拆为独立部署单元。不要为尚未出现的复用预先支付抽象成本。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 设计基础设施代码库 · 查看原书依据
Organizing a single stack’s code into modules adds overhead and moving parts to the codebase, like versioning and dependency management. Building a reusable module when you don’t need to reuse it is an example of YAGNI, investing effort now for a benefit that you may or may not need in the future. Implementation When a
参考来源
- 位置:《Infrastructure As Code》第10章《设计基础设施代码库》(来源项目:book-sources;源文件:extracted/Infrastructure As Code/_epub-src/OEBPS/ch10.html)
- 结论依据:原文说明仅在一个栈中使用的模块,常只是组织文件的手段,却引入版本和依赖管理;本卡据此解释其用途及适用边界。
- 原始内容:Organizing a single stack’s code into modules adds overhead and moving parts to the codebase, like versioning and dependency management. Building a reusable module when you don’t need to reuse it is an example of YAGNI, investing effort now for a benefit that you may or may not need in the future. Implementation When a