09.
Observer Inside Symfony + Benefits
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.
4 Comments
Hi there,
I'm not sure that I understand this:
Are there any benefits in your specific case (the game) to hooked up all the observers before that Symfony serves the GameApplication ?
Another question, instead of using the subscribe method can we do something like that or it's break the Observer Pattern:
I, too, thought about using tagged iterators right away when watching this chapter. IMHO it makes what is happening much clearer than 'hacking' the kernel class. Especially since nowadays we can use the
#[TaggedIterator]attribute right in the constructor.Still, it's good to know how to use this technique. I bet it will come in handy at some point.
Absolutely, I love all these new DI attributes! ;)
Hey @Armel-Z
Not really, it's just a straight-forward approach to configure observers. That's how you would do it if you wouldn't rely of any frameworks
As long as you have a way to add/remove observers at runtime I don't think there's a problem with your approach
Great questions! Cheers!
"Houston: no signs of life"
Start the conversation!