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

What is Observer design pattern

Pragya Keshap answered on May 8, 2022 Popularity 8/10 Helpfulness 1/10

Contents


More Related Answers

  • What design pattern allows behavior to be added to an individual object
  • Java Observer pattern
  • The Observer pattern – advantages and disadvantages
  • mutation observer
  • observer pattern java
  • observer pattern java
  • What is the Observer design pattern and how is it used in Java?
  • Observable-Observer
  • java observable to observer
  • OBSERVER
  • gof observer pattern
  • Implementation With Observer
  • What is key advantage of observer pattern
  • Creating Observer
  • What are the examples of Observer design pattern in JDK?
  • Observer pattern usage example
  • Design Pattern:Observability
  • Observer
  • Here is a trait that implements the logic of the Observer Pattern:

  • What is Observer design pattern

    0

    Observer design pattern, there is a Subject that maintains the list

    of Observers that are waiting for any update on the Subject. Once

    there is an update in Subject it notifies all the observers for the

    change.

    E.g. In real life, students are waiting for the result of their test. Here

    students are the observers and test is the subject. Once the result of

    test is known, testing organization notifies all the students about

    their result.

    The most popular use of Observer pattern is in Model View

    Controller (MVC) architectural pattern.

    Main issue with Observer pattern is that it can cause memory leaks.

    The subject holds a strong reference to observers. If observers are

    not de-registered in time, it can lead to memory leak.

    https://refactoring.guru/design-patterns/observer/java/example#:~:text=Observer%20is%20a%20behavioral%20design,that%20implements%20a%20subscriber%20interface.

    Popularity 8/10 Helpfulness 1/10 Language java
    Source: Grepper
    Tags: java
    Link to this answer
    Share Copy Link
    Contributed on Feb 10 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10

    Closely Related Answers



    2
    Popularity 10/10 Helpfulness 2/10 Language java
    Tags: java
    Link to this answer
    Share Copy Link
    Contributed on May 08 2022
    Shawmoon A
    0 Answers  Avg Quality 2/10

    1
    Popularity 10/10 Helpfulness 2/10 Language whatever
    Link to this answer
    Share Copy Link
    Contributed on Nov 03 2022
    R K
    0 Answers  Avg Quality 2/10

    0
    Popularity 9/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Dec 26 2022
    Deepika Sahu
    0 Answers  Avg Quality 2/10

    0

    Observer design pattern is useful when you are interested in the state of an object and want to get notified whenever there is any change.

     In observer pattern, the object that watch on the state of another object are called Observer and the object that is being watched is called Subject.

    https://www.digitalocean.com/community/tutorials/observer-design-pattern-in-java

    Popularity 9/10 Helpfulness 1/10 Language java
    Source: Grepper
    Tags: java
    Link to this answer
    Share Copy Link
    Contributed on Jan 23 2023
    Anjali Sharma
    0 Answers  Avg Quality 2/10

    0
    Popularity 9/10 Helpfulness 1/10 Language csharp
    Link to this answer
    Share Copy Link
    Contributed on Jul 30 2023
    mahnaz foroutan
    0 Answers  Avg Quality 2/10

    0
    Popularity 9/10 Helpfulness 1/10 Language csharp
    Link to this answer
    Share Copy Link
    Contributed on Jul 30 2023
    mahnaz foroutan
    0 Answers  Avg Quality 2/10

    0
    Popularity 9/10 Helpfulness 1/10 Language javascript
    Source: Grepper
    Tags: javascript j
    Link to this answer
    Share Copy Link
    Contributed on Sep 17 2023
    Amjad Saeed
    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.