知识卡片
向后兼容保护消费者
向后兼容意味着修改实现、修复错误或增加功能时,现有消费者仍能按原契约正常使用。先找出显式及隐性契约,再用测试证明输入、输出和行为不变,才能安全替换底层实现。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Principles of Software Architecture Modernization》第5章《Assessments》(源文件:`_epub-src/OPS/ch05.xhtml`,归一化正文 [29316:33593))
- 结论依据:原文定义向后兼容为改动后不破坏现有消费者,并要求发现契约及验证输入、输出和行为。
- 原始内容:Backward compatibility is simple. You make code changes, fix bugs or introduce new features but you don’t break your existing consumers. For them, everything works as if nothing has changed.