dev-master
9999999-devA CommandBus base.
MIT
The Requires
- php >=5.4.0
- illuminate/container >=4.2
- illuminate/log >=4.2
The Development Requires
Wallogit.com
2017 © Pedro Peláez
A CommandBus base.
This package provides an opinionated base to get started using the Command Bus architecture in PHP. Most of what's here has been derived from code and discussions with @ShawnMcCool. The structure may not fit with everyone's definitions of how a Command Bus should be implemented, however it provides a path of little resistance for newcomers., (*1)
If you're unfamiliar with Command Bus style architecture I urge you to check out a talk that @ShawnMcCool gave at Laracon 2014. Another great resource on learning the concepts and reasons for this style of architecture is a series at Laracasts called Commands and Domain Events. For more advance reading and learning, check out Mathias Verraes' website., (*2)
This package comes by default with:, (*3)
How you stack them is up to you, however the ExecutionBus must come last to deliver the request to the final handle() call., (*4)
If you would like an example of how the buses are instantiated, check the service provider's register() included in the source here., (*5)
If you wish to integrate the commandbus with Laravel, there is one provided. You can simply add it to your providers array in app/config/app.php and start injecting the CommandBus\CommandBus interface into your controllers and classes., (*6)
'CommandBus\CommandBusServiceProvider',, (*7)
Note: The execution order of the busses is:Request -> LoggingBus -> ValidationBus -> ExecutionBus -> Handler. If you wish to re-arrange the bus execution order, by all means make your own service provider and reorganize them. You could even write your own bus if you wanted., (*8)
To set up an example request cycle, we simply need a request object and handler and response objects to match., (*9)
Examples can be found in the examples directory., (*10)
A CommandBus base.
MIT