Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommandBus middleware #28

Open
rhyslbw opened this issue Jan 24, 2016 · 1 comment
Open

CommandBus middleware #28

rhyslbw opened this issue Jan 24, 2016 · 1 comment

Comments

@rhyslbw
Copy link
Member

rhyslbw commented Jan 24, 2016

This is a continuation of the discussion from meteor-space/event-sourcing#41

http://tactician.thephpleague.com/middleware/
https://laravel.com/docs/5.0/bus#command-pipeline

Would a design along these lines cover it @qejk ? Seems to address the ordering issue

@rhyslbw
Copy link
Member Author

rhyslbw commented Jan 26, 2016

So on further review this covers the requirements I see for validation in the Space.eventSourcing.Router such as avoiding duplication, or rerunning application validation as a last layer of protection. As the name implies, this object is infrastructure that simply loads up the instance and passes the message (command or event) through for the EventSourceable to handle. While it seems like this is coupling concerns, it's reasonable since an EventSourceable is already aware of messages since it generates events and can trigger commands. The CQRS pattern enforces state change calls to be an immutable directive that only fails when exceptions occur, so if configuration is needed to maintain business rules, I'd suggest that still happen via [Dependency Injection in the EventSourceable](meteor-space/event-sourcing#52 in the form of a service

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant