dddk_core

Crates.iodddk_core
lib.rsdddk_core
version0.6.0
sourcesrc
created_at2022-01-22 13:14:18.996957
updated_at2024-02-21 22:22:43.192116
descriptionTactical DDD framework based on command_bus, event_bus and query_bus. It offers annex feature such as authorization, logging ...
homepagehttps://github.com/jultabary/4dk-core
repository
max_upload_size
id519146
size91,962
Julien Tabary (jultabary)

documentation

https://github.com/jultabary/4dk-core/tree/main/rust/project/core-rust

README

4dk-core

The core project implements the primary concept of this framework.
It implements the entites : Command, Event and Query.

Command

Command

A Command is an object which triggers a usecase of type CommandHandler. It is an order sent to the system. The transaction will result a list of Event.
A Command is dispatched to the correct handler trough a CommandBus.

CommandBus

A CommandBus valids the following trait fn dispatch(command: &Command) -> Vec<Box<dyn Event>>.
This project proposes the following commandbus:

  • CommandDispatcher: its new factory takes in entry a vector Vec<Arc<Box CommandHandlerInBus>> of CommandHandlerInBus. This bus dispatches Command to correct CommandHandler.



You can find in samples different bus composition.

Event

An Event is an object returned by a CommandHandler. An Event is a result of a business transaction. It could trigger usecases of type EventHandler
An Event is dispatched to its associates handlers through an EventBus.

Query

A Query is an object which triggers a usecase of type QueryHandler. It is a question asked to the system. A Response is returned from a QueryHandler.

QueryBus

An EventBus valids the following trait fn dispatch(query: &Query) -> Vec<Box<dyn Response>>.
This project proposes the following querybus:

  • QueryDispatcher: its new factory takes in entry a vector Vec<Arc<Box QueryHandlerInBus>> of QueryHandlerInBus. This bus dispatches Query to its correct QueryHandler.
Commit count: 0

cargo fmt