Mastering the Observer Pattern with System.Reactive in

Поділитися
Вставка
  • Опубліковано 16 лис 2024

КОМЕНТАРІ • 9

  • @DevLeader
    @DevLeader  11 місяців тому

    📌 Have you subscribed to my free weekly software engineering newsletter yet? You can check it out here:
    subscribe.devleader.ca

  • @mw-st3qm
    @mw-st3qm 11 місяців тому +2

    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!

    • @DevLeader
      @DevLeader  11 місяців тому

      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 😁

  • @bloopers2967
    @bloopers2967 11 місяців тому +1

    what can be the use case for this pattern, if you can tell one example please

    • @DevLeader
      @DevLeader  11 місяців тому +1

      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
      @bloopers2967 11 місяців тому

      @@DevLeader so can we use saga pattern instead of this?

    • @DevLeader
      @DevLeader  11 місяців тому +1

      @@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 🙂

    • @bloopers2967
      @bloopers2967 11 місяців тому +1

      @@DevLeader okay thank you for detailed explanation much appreciated ♥️

    • @DevLeader
      @DevLeader  11 місяців тому

      @@bloopers2967 of course! No worries 🙂 happy to try and help!