知识卡片
模拟边界的选择
短时视觉验证可在视图临时补数据,集中状态替身便于管理。要同时检验网络请求和界面管道,可把替身放在 HTTP 边界,接真实服务时主要切换地址。静态替身不会证明真实状态转移、权限或延迟正确。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Implementing frontend code and reacting to changes 章首与范围 · 查看原书依据
The last option is to keep the frontend code clean (not polluting it at all with mock data) and instead set up a mock server. This approach does have trade-offs, but it is the cleanest approach and requires the least (almost no)
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第12章《Implementing frontend code and reacting to changes》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch12.htm,阅读块 13)
- 结论依据:原文比较视图、状态容器和 mock 服务对前端代码与数据行为的影响。
- 原始内容:The last option is to keep the frontend code clean (not polluting it at all with mock data) and instead set up a mock server. This approach does have trade-offs, but it is the cleanest approach and requires the least (almost no)