知识卡片

问题卡 · 1980.z.6.g

部分保存与最终提交

理解等级:中级

复杂表单一次填全容易出错,机器客户端尤其难以修正多个相互关联的错误。

部分表单提交把“保存已填数据”和“开始业务处理”分开。客户端可每次提交一个字段,服务校验后保存并返回含已填值的新表单,直至最终提交或取消。

动作分为partialSubmit、refreshSubmit、resetSubmit、cancelSubmit与finalSubmit;重置清空重来,刷新只取当前状态。最终提交仍可校验跨字段依赖并返回纠错信息,不意味着所有字段必填。原书用GET演示保存过程,不能据此把有持久化副作用的GET当通用协议惯例。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 超媒体工作流 · 查看原书依据

      The key point of this recipe is to make it easy for users of any kind to submit data to the server. By separating “save my data” from “process this submission,” you can simplify interactions and make it easier to fix errors in the input. This really pays off when you are using an automated client to submit that data.

    参考来源

    - 位置:《RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)》第7章《超媒体工作流》§7.12(来源项目:book-sources;源文件:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch07.xhtml) - 结论依据:原文以部分表单提交把“保存已填数据”和“开始业务处理”分开的方式说明该用途;同节示例与讨论补充了卡内条件和边界。 - 原始内容:The key point of this recipe is to make it easy for users of any kind to submit data to the server. By separating “save my data” from “process this submission,” you can simplify interactions and make it easier to fix errors in the input. This really pays off when you are using an automated client to submit that data.