Domain-Driven Design framework, event sourcing supported, base on EDA and CQRS.
-
- Data Flow Diagram
LoadingsequenceDiagram participant C as Client participant CS as CommandService participant CD as CommandDispatcher participant CH as CommandHandlers participant R as Repository participant ES as EventStore participant EB as EventBus participant ED as EventDispatcher participant EH as EventHandlers participant RM as ReadModel C->>CS: send command activate CS CS->>CD: transport command activate CD CD->>CH: dispatch command activate CH alt Business Logic Checking Success CH->>CH: business logic checking, execute business logic CH->>R: save aggregate state activate R R->>ES: save eventstream activate ES ES-->>R: confirm of save success deactivate ES R->>EB: push to event bus activate EB R-->>CH: confirm of save success deactivate R CH-->>CD: handle command complete deactivate CH CD->>CS: notify that handle command success deactivate CD CS-->>C: execute command success from command deactivate CS EB->>ED: transport event activate ED deactivate EB ED->>EH: dispatch event activate EH EH->>EH: handle event EH->>RM: update read-model activate RM RM-->>EH: confirm of update success deactivate RM EH-->>ED: handle event complete deactivate EH deactivate ED else Business Logic Checking Fail activate CH CH-->>CD: return error activate CD deactivate CH CD->>CS: notify that handle command fail activate CS deactivate CD CS-->>C: execute command fail deactivate CS end C->>RM: query data activate RM RM-->>C: return data deactivate RM Note right of C: process of CQRS and eventsourcing is end
-
- Event Sourcing
Save eventstream when aggregate changed. And also can been restored from eventstreams and snapshot.
-
- Save
eventstreamtoeventstore
- Save
-
- Publish
eventstreamtoeventbus
- Publish
-
- Take snapshot for
aggregatetosnapshotstore
- Take snapshot for
-
- EDA
Publish events and handle them. In event handler, you can also publish another events.
-
- Support user-customized
proxyfor event handler
- Support user-customized
-
- Support notify when command-id related eventstream handled
-
- Support parallel handling events by different mailbox's name
-
- Record published eventstream to
publishedstorewhen published to eventbus success
- Record published eventstream to
-
- Support parallel handling same event with different event handlers
-
- CQRS
Send command to command service and returns two results: one is when command handled, the other is when command-id related eventstream handled.
-
- Support user-customized
proxyfor command handler
- Support user-customized
-
- Support notify when command handled
-
- Support parallel handling commands by different mailbox's name
-
- Support process manager, for communication with multiple aggregate instances