dolittle / Bifrost

This is the stable release of Dolittle till its out of alpha->beta stages
Other
110 stars 38 forks source link

Command + CommandCoordinator in the client should be simplified -> Refactored #506

Open einari opened 10 years ago

einari commented 10 years ago

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.

einari commented 10 years ago

Another consequence of this is the CommandDescriptor.js that gets polluted!