-
Notifications
You must be signed in to change notification settings - Fork 4
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
Using a CommandHandler #1
Comments
Hi Jose ! I'm of course in favor of using Command Bus! In order to move some legacy code, it could make sense sometimes to not follow full recommendations as the goal is to simplify the comprehension and the reading of your legacy code. But for a new project or a project with dedicated time to improve, I would add a real commandbus of course.
But I disagree with this part. BookingService is an application service not a domain service. No problem to make it fat. I prefer big application service that make sense for a big Bounded Context, that many and many Command Handler class, totally separate. That help to think in Bounded Context IMO. Again, we are talking about details, the main move here is to move to the Command Pattern, whatever the way to get there. Hope it helps. |
Thanks Timothée. I am trying to find the best way to implement a MessageBus in Symfony 2. I have found these two repositories: https://github.com/SimpleBus I would like to find an Symfony example application with one of them. |
I use litecqrs on my other sandbox : https://github.com/tyx/cqrs-php-sandbox/blob/master/src/Afsy/UI/SymfonyBundle/Resources/config/commands.yml For now, it is the best I see, but Benjamin is no more very active on it : ( I don't give a try to the other ones that pop the last monthes. |
In your controller:
https://github.com/tyx/ddd-sample-symfony/blob/master/src/BookingEngine/UI/Controller/BookingController.php#L50
You use a service and pass a command as parameter.
This other Symfony DDD exmaple uses a CommandHandler:
https://github.com/leopro/trip-planner/blob/master/src/Leopro/TripPlanner/PresentationBundle/Controller/ApiController.php#L27
In that sample payBooking would use a Use Case.
Prons:
This other sample uses commandBus instead of CommandHandler:
https://github.com/tyx/cqrs-php-sandbox/blob/master/src/Afsy/UI/Controller/GameCommandController.php
I am trying to figure out which is the best option to implement DDD in a project with Symfony. Perpahs a mixing of them or it depends on the domain. What do you think?
The text was updated successfully, but these errors were encountered: