知识卡片
命令可拒事件已成事实
消息可表达命令或事件。命令要求执行操作,可因无效或违反业务规则被拒;事件描述已经发生的事实,接收者不能取消它,只能另发命令执行补偿。事件应使用过去时名称;异步传输本身不能把一个操作请求变为事实。事件通常由类型、事件ID、关联ID和时间戳等元数据,以及表达事件信息的负载组成;可序列化记录只是载体,消息语义仍由业务含义决定。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 事件驱动架构 · 查看原书依据
An event is something that has already happened, whereas a command is an instruction to do something. Both events and commands can be communicated asynchronously as messages. However, a command can be rejected: the command’s target can refuse to execute the command, for example, if the command is invalid or if it contradicts the system’s
参考来源
- 位置:《Learning Domain-Driven Design》第15章《事件驱动架构》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Learning Domain-Driven Design/_epub-src/OEBPS/ch15.html)
- 结论依据:原文比较两类消息的时态、拒绝及补偿语义。
- 原始内容:An event is something that has already happened, whereas a command is an instruction to do something. Both events and commands can be communicated asynchronously as messages. However, a command can be rejected: the command’s target can refuse to execute the command, for example, if the command is invalid or if it contradicts the system’s