知识卡片
公共事件隔离内部模型
把多个消费者共同需要的状态投影放回生产者,并作为发布语言输出ECST,可同时减少重复逻辑与内部实现依赖。消费者确需等待计算结束时,让计算方发布完成通知后再取结果。公共事件应有意设计并与私有事件区分,领域事件只选择必要的公开子集,不直接泄露事件存储全集。
结构图:
flowchart LR
I[内部领域事件] --> P[生产者投影]
P --> E[公共状态传递]
E --> C1[消费者一]
E --> C2[消费者二]
W[计算完成] --> N[完成通知]
N --> Q[下游查询结果]
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 事件驱动架构 · 查看原书依据
Both implementation and functional coupling can be tackled by encapsulating the projection logic in the producer: the CRM bounded contexts. Instead of exposing its implementation details, the CRM can follow the consumer-driven contract pattern: project the model needed by the consumers and make it a part of the bounded context’s published language—an integration-specific model, decoupled
参考来源
- 位置:《Learning Domain-Driven Design》第15章《事件驱动架构》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Learning Domain-Driven Design/_epub-src/OEBPS/ch15.html)
- 结论依据:原文把投影归还CRM并让计算方发通知,以消费者驱动契约和发布语言解耦。
- 原始内容:Both implementation and functional coupling can be tackled by encapsulating the projection logic in the producer: the CRM bounded contexts. Instead of exposing its implementation details, the CRM can follow the consumer-driven contract pattern: project the model needed by the consumers and make it a part of the bounded context’s published language—an integration-specific model, decoupled