Skip to content
Simon Bennett edited this page Nov 17, 2015 · 4 revisions

Command Bus

Read Smooth php Command Docs first

Command should have no strong types in them (value objects) keep to primitives, use the handler for generating the valueobjects. Makes the commands easier to log and network.

Commands extend base command. Don't forget to call the parent constructor

Command Handlers

Command handlers are where you can inject dependancies into the aggregate. Make sure you use interfaces for the sake of testing. injecting service example

All handlers will have a instance of the Aggregate Repository and the handler will finish with

$this->repo->save($agg);
Clone this wiki locally