none
Notification with/without IObserver RRS feed

  • Question

  • Even though wihout IObserver, we can send some notification to other instance of class.

    Then what is advantages when we use IObserver interface?

    Wednesday, October 10, 2018 6:07 PM

Answers

  • Hi Jeff0803,

    Thank you for posting here.

    A quick answer, the Observer pattern provides you with the following advantages:

    • It supports the principle of loose coupling between objects that interact with each other.
    • It allows sending data to other objects effectively without any change in the Subject or Observer classes.
    • Observers can be added/removed at any point in time.

    For mode details, please refer to the MSDN document Observer Design Pattern Best Practices.

    https://docs.microsoft.com/en-us/dotnet/standard/events/observer-design-pattern-best-practices

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Jeff0803 Thursday, October 11, 2018 2:25 PM
    Thursday, October 11, 2018 7:18 AM
    Moderator

All replies

  • Hi Jeff0803,

    Thank you for posting here.

    A quick answer, the Observer pattern provides you with the following advantages:

    • It supports the principle of loose coupling between objects that interact with each other.
    • It allows sending data to other objects effectively without any change in the Subject or Observer classes.
    • Observers can be added/removed at any point in time.

    For mode details, please refer to the MSDN document Observer Design Pattern Best Practices.

    https://docs.microsoft.com/en-us/dotnet/standard/events/observer-design-pattern-best-practices

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Jeff0803 Thursday, October 11, 2018 2:25 PM
    Thursday, October 11, 2018 7:18 AM
    Moderator
  • Thanks for kind answer.

    I'm wondering if you can let me know some practical cases which observer pattern can be used.

    Thursday, October 11, 2018 3:23 PM