Today the command is doing things one is not expecting a command to be doing :
It knows there is a validation system and hooks up the command.
It knows there is a security system and hooks up the command.
It knows how to execute the command and has as a result a reference to the commandCoordinatorService.
The command should be "stupid" in the sense that it should in reality have no logic on it. It is a vessel for information related to the command. Today, commands have observables, these are extended with services such as validator, security and similar - the command itself takes on the responsibility of doing all this. Figure out a better way of doing this.
At the very least, execution should not be part of the commands "vocabulary".. The commandCoordinator is perfect for this and the command does not need to know there is a commandCoordinator.
Today the command is doing things one is not expecting a command to be doing :
It knows there is a validation system and hooks up the command. It knows there is a security system and hooks up the command. It knows how to execute the command and has as a result a reference to the commandCoordinatorService.
The command should be "stupid" in the sense that it should in reality have no logic on it. It is a vessel for information related to the command. Today, commands have observables, these are extended with services such as validator, security and similar - the command itself takes on the responsibility of doing all this. Figure out a better way of doing this.
At the very least, execution should not be part of the commands "vocabulary".. The commandCoordinator is perfect for this and the command does not need to know there is a commandCoordinator.