11.
Clase de evento Pub Sub y suscriptores en Symfony
Keep on Learning!
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
If you liked what you've learned so far, dive in! Subscribe to get access to this tutorial plus video, code and script downloads.
Whoops, an error! Please, try again later.
3 Comments
Why does the name of the subscriber explain what the subscriber does instead of what it is? Since it only subscribes, I would expect it to be named
FightStartingSubscriber(without the Output action). Doing that, I would also find the following code more logical:Is there any definition how the naming should be done here? Or best practices?
Hey @martcor
You've made the hardest question ever, how to name things properly. It's always difficult to find a good name for your classes and methods, in this case, we wanted to be explicit about what the subscriber does, but of course, you can give it the name that makes more sense in the context of your application. Since subscribers are bound to a specific event and action, I like to be explicit about what they do so I can quickly find the subscriber I'm looking for.
Perhaps this blog post can give you a guideline on how to name things https://makimo.pl/blog/scientific-perspective-on-naming-in-programming/
Cheers!
So this one is free for interpretation.
Thank you for your time to answer my question :)
"Houston: no signs of life"
Start the conversation!