知识卡片
配置描述结果而非环境
可复用栈若直接判断 dev、test、prod 并决定资源配置,就知道了过多部署上下文。新增环境会迫使修改和重测共享代码。把实例值移到外部,或把参数命名为 S/M/L 等明确能力规格,能够测试各规格的行为,再由环境选择规格。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 配置基础设施栈实例 · 查看原书依据
The Configuration in Code antipattern differs from simply having options in the code in that it’s tied to the specific instances. The antipattern violates the law of Demeter, also known as the principle of least knowledge. The stack code knows too much about where it may be deployed. Motivation Implementing instance Configuration in Code is
参考来源
- 位置:《Infrastructure As Code》第8章《配置基础设施栈实例》(来源项目:book-sources;源文件:extracted/Infrastructure As Code/_epub-src/OEBPS/ch08.html)
- 结论依据:原文说明可复用栈若直接判断 dev、test、prod 并决定资源配置,就知道了过多部署上下文;本卡据此解释其用途及适用边界。
- 原始内容:The Configuration in Code antipattern differs from simply having options in the code in that it’s tied to the specific instances. The antipattern violates the law of Demeter, also known as the principle of least knowledge. The stack code knows too much about where it may be deployed. Motivation Implementing instance Configuration in Code is