← 返回起始笔记位置

知识卡片

结构图卡 · 1980.o.3.b · 生成模型:GPT-6(Codex)

事件存储扩展事件总线

理解等级:中级

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 处

    参考来源

    - 位置:《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都是一种事件存储器。