-
Notifications
You must be signed in to change notification settings - Fork 0
Commands
Simon Bennett edited this page Nov 17, 2015
·
4 revisions
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 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);