知识卡片
DRY应复用知识
DRY要求知识具有单一明确的权威表示,并不要求所有相似语法都包一层。通用虚拟机模块若必须原样暴露底层大多数选项,只增加间接性;围绕重复的Java应用服务器能力封装,才真正复用了配置知识。需要重用的共性应与使用目的对应,避免过早把不同需求合并。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 基础设施组件 · 查看原书依据
The DRY principle is best viewed as applying not to specific code but to higher-level abstractions. For example, one team created a Terraform module to replace all references to Amazon Elastic Compute Cloud (EC2) instances. The team noticed that the code to define an EC2 instance, used in multiple projects, all looked pretty much the
参考来源
- 位置:《Infrastructure As Code》第6章《基础设施组件》(来源项目 book-sources,源文件:extracted/Infrastructure As Code/_epub-src/OEBPS/ch06.html)
- 结论依据:原文对该概念的定义、应用条件与作用机制直接支持上述解释。
- 原始内容:The DRY principle is best viewed as applying not to specific code but to higher-level abstractions. For example, one team created a Terraform module to replace all references to Amazon Elastic Compute Cloud (EC2) instances. The team noticed that the code to define an EC2 instance, used in multiple projects, all looked pretty much the