知识卡片

普通读书笔记卡 · 2313.e.5.f.10.b.3.i.2.e.1.b · 生成模型:未记录

设计视图与线上视图

理解等级:中级

待实现视图(to-be)表达已经设计但未必实现的 API 变化,供设计者、评审者和开发团队工作。线上视图(as-is)表达当前可用契约,供发布门户和老版本使用方查询。两者会在实现与发版期间暂时分开。例如规格已增加评分和评论总数字段,但服务还缺字段时,新规格属于 to-be,线上门户仍应描述旧响应。

基于同一规格确认版本、生成服务骨架、SDK 和文档,待业务完整实现并发布后才更新线上视图。必要时可从实际实现导出规格,与待实现契约做差异对照。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 通过代码与定义生成促进遵约 6.2 Generating code from OpenAPI · 查看原书依据

      With the SOT approach, I find it useful to have two views of an API definition—a to-be view and an as is view. The to-be view is the forward-looking design view of the API definition that contains changes that reflect what the API should do but which may not yet be generated in code. The as is view is the API definition that accurately reflects what is implemented in the API right now.

    参考来源

    - 位置:《Automating API Delivery APIOps with OpenAPI》《第 06 章 通过代码与定义生成促进遵约》(6.2 Generating code from OpenAPI;来源项目 book-source,extracted/Automating API Delivery APIOps with OpenAPI/_epub-src/OEBPS/Text/chapter-6.xhtml#p116) - 结论依据:用目录版本更新说明待实现视图与已实现视图的时序差异。 - 原始内容:With the SOT approach, I find it useful to have two views of an API definition—a to-be view and an as is view. The to-be view is the forward-looking design view of the API definition that contains changes that reflect what the API should do but which may not yet be generated in code. The as is view is the API definition that accurately reflects what is implemented in the API right now.