this seems similar to the Microsoft.Toolkit.Mvvm.Messaging, but maybe a bit simpler as you dont need to worry about a scope? i have used IMessenger in situations where i had potentially hundreds of children and wondered about maximizing performance on that. cool video though thanks!
Oh cool! I've not actually used the Microsoft library you mentioned so I might have to go digging a bit more to understand better! Thanks for sharing and stopping by 😁
For sure! In the most generic sense: if you have modules in your program that need to be notified about changes from other modules. I'm using the word "module" to try and be generic, but it's often just a simple class. I've used patterns like this a lot for user interfaces, for example, when I need to update some state based on another change.
@@bloopers2967 different purposes 🙂 I'd use the observer pattern like this for something within a service/app, quick running, and in the same processing/memory space. Sagas and other types of messaging/queuing are super useful for communication between different applications/services. Sagas in particular when they're long running. All the above are ways that things can talk to each other, but just different situations and use cases 🙂
📌 Have you subscribed to my free weekly software engineering newsletter yet? You can check it out here:
subscribe.devleader.ca
this seems similar to the Microsoft.Toolkit.Mvvm.Messaging, but maybe a bit simpler as you dont need to worry about a scope?
i have used IMessenger in situations where i had potentially hundreds of children and wondered about maximizing performance on that. cool video though thanks!
Oh cool! I've not actually used the Microsoft library you mentioned so I might have to go digging a bit more to understand better!
Thanks for sharing and stopping by 😁
what can be the use case for this pattern, if you can tell one example please
For sure!
In the most generic sense: if you have modules in your program that need to be notified about changes from other modules. I'm using the word "module" to try and be generic, but it's often just a simple class.
I've used patterns like this a lot for user interfaces, for example, when I need to update some state based on another change.
@@DevLeader so can we use saga pattern instead of this?
@@bloopers2967 different purposes 🙂
I'd use the observer pattern like this for something within a service/app, quick running, and in the same processing/memory space.
Sagas and other types of messaging/queuing are super useful for communication between different applications/services. Sagas in particular when they're long running.
All the above are ways that things can talk to each other, but just different situations and use cases 🙂
@@DevLeader okay thank you for detailed explanation much appreciated ♥️
@@bloopers2967 of course! No worries 🙂 happy to try and help!