知识卡片
版本化契约需控制共存成本
不可避免的破坏性改动可通过新路径、域名、元数据或接口版本与旧契约并存。但每个版本都增加维护和转换成本,发布时应规划消费者迁移与旧版退役。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Principles of Software Architecture Modernization》第6章《Principles of Proper Services》(源文件:`_epub-src/OPS/ch06.xhtml`,归一化正文 [42245:46481))
- 结论依据:原文列出多种 API 版本化位置,并指出并行维护版本数过多会变难。
- 原始内容:API versioning: Introduce the change in a new version of the public contract exposed by the service; there are several strategies for this approach such as: Version using FQDN 69 , e.g. profilev1.acme.internal vs profilev2.acme.internal Version using the URL path e.g. /profile/v1/ vs /profile/v2/ Version using the package level or object level e.g. ProfileContractV1 vs ProfileContractV2 Use version metadata, e.g.