知识卡片

问题卡 · 1980.z.6.e

声明文档分离执行策略

理解等级:中级

若希望改进工作流执行器而不反复改写流程定义,可以让描述与处理代码分离。

声明式工作流文档描述作业、任务、共享状态、标识与管理动作,由理解词汇的执行器决定如何完成。把描述与执行代码分开,允许改进引擎而不反复改写流程文档。

文档应保持描述性;把if/else、变量判断等大量塞进作业文档,会使其重新变成命令式语言。业务判断留在任务内;确实需要命令式控制时,采用[[专用脚本降低编排成本]]或代码。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

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

      The advantage of using declarative documents for workflows is that you are separating the description details from the processing code. This makes it possible to change the code frequently and improve it over time without needing to change the document format or contents. Document-driven workflows are effective when you are dealing with workflow-compliant service interfaces, as described in this book.

    参考来源

    - 位置:《RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)》第7章《超媒体工作流》§7.5(来源项目: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 advantage of using declarative documents for workflows is that you are separating the description details from the processing code. This makes it possible to change the code frequently and improve it over time without needing to change the document format or contents. Document-driven workflows are effective when you are dealing with workflow-compliant service interfaces, as described in this book.