Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Observer

Sumit Rawal answered on December 26, 2021 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • mutation observer js
  • javascript event observer
  • mutation observer
  • observer design pattern
  • observer pattern
  • Observable-Observer
  • What Is the Observer Pattern?
  • java observable to observer
  • Implementation With Observer
  • Creating Observer
  • observer design pattern
  • What is Observer design pattern
  • Observer Pattern
  • Observer pattern
  • observer pattern design pattern

  • Observer

    0

    This pattern is a one-to-many dependency between objects so that when one object changes state, all its dependents are notified. This is typically done by calling one of their methods.

    For the sake of simplicity, think about what happens when you follow someone on Twitter. You are essentially asking Twitter to send you (the observer) tweet updates of the person (the subject) you followed. The pattern consists of two actors, the observer who is interested in the updates and the subject who generates the updates.

    A subject can have many observers and is a one to many relationship. However, an observer is free to subscribe to updates from other subjects too. You can subscribe to news feed from a Facebook page, which would be the subject and whenever the page has a new post, the subscriber would see the new post.

    Key consideration: In case of many subjects and few observers, if each subject stores its observers separately, it’ll increase the storage costs as some subjects will be storing the same observer multiple times. 

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Tags: whatever
    Link to this answer
    Share Copy Link
    Contributed on May 14 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10

    Closely Related Answers



    0
    Popularity 3/10 Helpfulness 1/10 Language csharp
    Tags: c#
    Link to this answer
    Share Copy Link
    Contributed on Dec 26 2021
    Misty Manatee
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.