知识卡片
共享模式避免约束漂移
同义数据契约集中定义,其他位置引用,能避免升级只改部分副本。共享前核对语义、读写方向与生命周期,例如密码或服务端生成标识不宜机械复用在所有请求和响应上。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Creating an API design using OpenAPI 10.1 The problem · 查看原书依据
In total, there are four places where we’d need to make a change. Changing something in four places in a file doesn’t seem like an impossible burden for a developer, but it introduces a margin for error. Imagine what could go wrong
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第10章《Creating an API design using OpenAPI》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch10.htm,阅读块 38)
- 结论依据:从五级改十级的例子说明多个副本会使不同消费者依赖冲突约束。
- 原始内容:In total, there are four places where we’d need to make a change. Changing something in four places in a file doesn’t seem like an impossible burden for a developer, but it introduces a margin for error. Imagine what could go wrong