Great series Mike. I really love how you provide a step-by-step guidance from a naïve implementation to more sophisticated solutions. That’s a powerful way how students can better understand why the pattern ended up this way. Really inspiring, thanks a lot.
Hello Prof. Shah, thanks again for your video! I watched your CppCon lecture about the observer pattern and the part 1 and 2 of the observer pattern on your personal channel. One thing that I've been thinking is what if we want those observers to communicate with each other? For example, the observer 1 tells observer 2 if the angry bird hit the stone, and the observer 2 use the final position and the velocity of the bird to see if it should become "multiple small birds". So, in this case, the observer 2 needs the input from both the subject and the observer 1. It'd be something like inheritance-based observer pattern? Is there such a design pattern? Thank you! :)
Observers can certainly 'observe' each other (i.e. one observe is the 'subject' of the other). If you think there's a lot of these types of dependencies, I might suggest some sort of 'event' system -- i.e. The observe posts events to some queue of 'hey this thing happened, now consume the event and do something with that data to create the small birds'. Check out 'event queues' or perhaps even the 'mediator pattern'
Hi, really great series! Thanks for sharing this with the community. It would be good if you also talk about performance on each implementation. Is there any penalty in performance by using this approach with (virtual) interfaces? Are there other options that can work better in this regard? Can we use this code in, for example, the game main loop code?
Great series Mike. I really love how you provide a step-by-step guidance from a naïve implementation to more sophisticated solutions. That’s a powerful way how students can better understand why the pattern ended up this way. Really inspiring, thanks a lot.
Cheers, thank you for the kind words! There's at least another 2 more episodes coming to continue building on the implementation 😀
Fantastic,....understood fully :)
Cheers!
Oh hi. I saw this guy on the conference :)
Hello! Welcome!
Hello Prof. Shah, thanks again for your video! I watched your CppCon lecture about the observer pattern and the part 1 and 2 of the observer pattern on your personal channel. One thing that I've been thinking is what if we want those observers to communicate with each other? For example, the observer 1 tells observer 2 if the angry bird hit the stone, and the observer 2 use the final position and the velocity of the bird to see if it should become "multiple small birds". So, in this case, the observer 2 needs the input from both the subject and the observer 1. It'd be something like inheritance-based observer pattern? Is there such a design pattern? Thank you! :)
Observers can certainly 'observe' each other (i.e. one observe is the 'subject' of the other). If you think there's a lot of these types of dependencies, I might suggest some sort of 'event' system -- i.e. The observe posts events to some queue of 'hey this thing happened, now consume the event and do something with that data to create the small birds'. Check out 'event queues' or perhaps even the 'mediator pattern'
@@MikeShah Thank you so much for your help! I will look into them and see what I can do! :) Have a nice weekend!
@@k0185123 Cheers!
Hi, really great series! Thanks for sharing this with the community. It would be good if you also talk about performance on each implementation. Is there any penalty in performance by using this approach with (virtual) interfaces? Are there other options that can work better in this regard? Can we use this code in, for example, the game main loop code?
Cheers, thank you for the kind words! Good idea, I think I'll touch on a few of those things in some later parts coming up 🙂
"Yes, I know you can't read this. You can download and read this later :)"