Command Bus is a very powerful pattern, which can help you in decoupling your application modules. You can in an easy way separate small actions, a...
For further actions, you may consider blocking this person and/or reporting abuse
Where does the
fromRawinReserveResourcecome from? Is the implementation simply ommited in the class definitinion for the sake of brevity? Or is there some other magic going on?No, there is no magic 😄. That's just a static method in ReserveResource that takes list of parameters, and builds ReserveResource object based on them.
And another question.. How would you recommend to go about receiving the outcome of the Reservation. Just a separate query service?
It really depends on your needs 😉. Just a good practice is to keep reads and writes separate.
Yes, it could be a separate query bus, that sends queries and returns data. You can also build a read model, which is a simple CRUD implementation used directly in the controller, and just update it through events in your system. Even updating the database directly through events and then retrieving data using SQL could be fine as far as you keep your reads and writes separately.
I've used a solution with CRUDs updated through events, in my karting app, you can check it out here 😄: github.com/mtk3d/karting
Why there's not comments?! Command Bus is an amazing pattern and should be implemented as a common in many projects.
Thanks for your post.