Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
ChannelingDisplay.java
DisplayElement.java
README.md
StockData.java
StockMarket.java

README.md

DESIGN PATTERN - OBSERVER

TYPE - BEHAVIORAL

The Observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

This example uses the Java built-in Observer Pattern - java.util.Observer & java.util.Observable

The pull method is used for the observer, ChannelingDisplay, to grab Stock price changes from the subject(observable) StockData

Examples of the Observer Pattern in the JDK include

java.util.Observer/Observable javax.servlet.http.HttpSessionBindingListener javax.servlet.http.HttpSessionAttributeListener javax.faces.event.PhaseListener