知识卡片
专用脚本降低编排成本
流程多且经常变化时,反复用通用代码处理HTTP和表单会提高交付成本。
工作流DSL把HTTP请求、查找表单、填入共享状态等重复细节收进有限指令,让流程作者专注连接任务。典型HyperCLI片段是REQUEST WITH-FORM cartCheckout WITH-STACK,从共享栈填入并提交发现的表单。
限制语言能力能减少错误空间,但不适合所有复杂判断。shell配合curl、jq也能实现编排,灵活性更高,同时需承担解析与错误处理。选DSL取决于流程变化频率和组织维护能力,书中HyperCLI语法仅为该工具示例。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 超媒体工作流 · 查看原书依据
A hypermedia DSL like the one shown in this example can streamline workflow authoring since many of the details (e.g., handling HTTP requests, locating and filling in forms in a response, etc.) are handled by the DSL directly. If you were using code (see Recipe 7.3), you’d need to deal with this yourself (possibly through a shared code library).
参考来源
- 位置:《RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)》第7章《超媒体工作流》§7.4(来源项目:book-sources;源文件:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/ch07.xhtml)
- 结论依据:原文以工作流DSL把HTTP请求、查找表单、填入共享状态等重复细节收进有限指令,让流程作者专注连接任务的方式说明该用途;同节示例与讨论补充了卡内条件和边界。
- 原始内容:A hypermedia DSL like the one shown in this example can streamline workflow authoring since many of the details (e.g., handling HTTP requests, locating and filling in forms in a response, etc.) are handled by the DSL directly. If you were using code (see Recipe 7.3), you’d need to deal with this yourself (possibly through a shared code library).