知识卡片
事件存储扩展事件总线
EventBus 的核心职责是发布事件给处理器。EventStore 还负责存取历史,形成聚合回放的数据源。使用只分派的实现时,需要另行判断历史能否满足恢复需求。图中空心三角表示接口继承或类对接口的实现,虚线连接表示实现。
结构图:
classDiagram
class EventBus {
<<interface>>
}
class EventStore {
<<interface>>
}
class SimpleEventBus
class AxonServerEventStore
class EmbeddedEventStore
EventBus <|-- EventStore
EventBus <|.. SimpleEventBus
EventStore <|.. AxonServerEventStore
EventStore <|.. EmbeddedEventStore
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 案例实现:事件溯源和CQRS 11.4.3 EventBus 和 EventStore · 查看原书依据
请注意,从类的命名上看,除了SimpleEventBus是一种单纯的EventBus之外,Axon-ServerEventStore和EmbeddedEventStore都是一种事件存储器。
参考来源
- 位置:《DDD工程实战:从零构建企业级DDD应用》第11章《案例实现:事件溯源和CQRS》,11.4.3 EventBus 和 EventStore(book-source:extracted/DDD工程实战:从零构建企业级DDD应用/_epub-src/converter-master/example/156889/157.html)
- 结论依据:原文指出 EventStore 扩展 EventBus,且两种具体 EventStore 同时具备存储和分派能力。
- 原始内容:请注意,从类的命名上看,除了SimpleEventBus是一种单纯的EventBus之外,Axon-ServerEventStore和EmbeddedEventStore都是一种事件存储器。