You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 28, 2022. It is now read-only.
##Background:
I have a command/event/query bus implementation for business logic separated by business domain.
I would like to forbid commands to trigger other commands es this should be done via events.
##Example:
Wrong:
class XCommandHandler implements CommandHandler {
publicfunctionhandle(XCommand$command); void
{
// do whatever needs to be done$this->commandBus->dispatch(newOtherCommand());
}
}
class OtherCommandHandler implements CommandHandler {
publicfunctionhandle(OtherCommand$command); void
{
// do whatever needs to be done
}
}
Correct:
class XCommandHandler implements CommandHandler {
publicfunctionhandle(XCommand$command); void
{
// do whatever needs to be done$this->eventBus->dispatch(newXSucceededEvent());
}
}
class OnXSucceededTriggerOther implements EventHandler {
publicfunctionhandle(XSucceededEvent$event); void
{
// do whatever needs to be done$this->commandBus->dispatch(newOtherCommand());
}
}
class OtherCommandHandler implements CommandHandler {
publicfunctionhandle(OtherCommand$command); void
{
// do whatever needs to be done
}
}