Hey man, I'm here from Brazil, I've been working with PHP code since 2007. Your passion about programming and focus on PHP has been a refresh in my love and motivation for this science and art, Thanks
@batlin7 ай бұрын
As soon as you described them, I was thinking "this is going to be much more testable", since you have a flatter hierarchy with less direct dependencies. Reminds me a bit of Smalltalk's late binding and the Lua-based game engine Defold's message system -- instead of having a complicated and brittle web of direct dependencies, scripts just broadcast messages and listen for ones they care about.
@bambamboole111 ай бұрын
It’s a very powerful pattern, when you get used to not return stuff from the handlers. Then all of the commands can be easily queued. Connect it via events with websockets to the frontend again and it feels like a super power.
@Plytys Жыл бұрын
Would like to see an example how you refactor some piece of code to command bus.
@phpannotated Жыл бұрын
Very nice idea! I might do a livestream about it soon :)
@Alpheus211 ай бұрын
@@phpannotated Happy to pair on stream if you want some backup on the refactor plus discussion.
@turboclown Жыл бұрын
This is very interesting, I hope you'll give some examples in your blog or even open source the code you wrote. I'd love to learn.
@phpannotated Жыл бұрын
I plan on writing a post about it as well soon :)
@jean-marcstrauven2990 Жыл бұрын
Please, make a article or show a exemple..it's really interesting.
@phpannotated Жыл бұрын
I'm drafting a blog post about it as well :)
@Gexsi0 Жыл бұрын
I think you should also mention one more benefit. Your commands can be executed synchronously or asynchronously.
@phpannotated Жыл бұрын
True, thanks for pointing that out! I actually thought I mentioned it briefly, but I cut that part out last minute 😬
@metaphoricallyspeaking Жыл бұрын
It's great to hear someone talking so positively about introducing a Command Bus - the benefits are incredible. I'd still use one if I was building a blog, btw! :)
@jelmerprins Жыл бұрын
As a big fan of command busses and the number 1 on the leaderboard of the game, thank you :D I am a bit sad that i have to adjust my deck since something got fixed that was apparently a bug, but the game is still a lot of fun. I would disagree on the crud app though, but maybe that is a symfony vs laravel thing. I also find it useful for crud and with a maker I can easily generate most of the code
@Aerendir11 ай бұрын
Can you explain better what do you mean with “with a maker I can easily generate most of the code”? 🙏🏻
@AlexMerlin1985 Жыл бұрын
4:44 That missing closing parenthesis after the call to command, though... :)
@phpannotated Жыл бұрын
Oh oh 😳
@anupam.sam9 Жыл бұрын
Can you link your project in the description for better understanding of the full implementation...?
@phpannotated Жыл бұрын
It's not open source at the moment. But I will do some livestreams about it in the future :)
@jonashansen2512 Жыл бұрын
A little bit of CQRS goes a long way 😊
@BrunoBernard-kn6vt8 ай бұрын
Please share the repo
@wildfoster11 ай бұрын
Command bus? Is it like a list of class object, grouped together to be dispatched somewhere else? I am kinda confused here
@xiCO2k Жыл бұрын
Next refactor should be change from PHPUnit to Pest 🌶
@robwatson826 Жыл бұрын
I love a command bus. Glad you've seen the light! Interested to know how you handle situations where the command changes some data and you want to send that data back to the client? Do you just make a new query to fetch the updated data? Or do you leave that up to the client to make another request for it?
@phpannotated Жыл бұрын
If you follow CQRS, then commands and querying are indeed two concernes that are fully separated. That means no returning from handlers directly. It means that after having dispatched a command, you'll have to re-query the read model manually. I briefly mentioned it in the video, but it's a super interesting topic that's probably worth some content on its own.
@roky2822 Жыл бұрын
@@phpannotated can you recommend good information sources about CQRS. I can google myself sure, but I'm interested which sources would you personally recommend?
@phpannotated Жыл бұрын
@@roky2822 I once wrote a blog post where I bundled the talks that got me started, it's a good entry point :) stitcher.io/blog/my-journey-into-event-sourcing If you want to learn more, Greg Young's talks are excellent :)
@NedumEze Жыл бұрын
Never heard of 'Command Boss'. Is it your invention? Any plans for literature or articles on it?