What are the examples of Observer design pattern in JDK?

In JDK there are many places where Observer design pattern is used. Some of these are as follows:

  • java.util.Observer, java.util.Observable
  • javax.servlet.http.HttpSessionAttributeListener
  • javax.servlet.http.HttpSessionBindingListener
  • All implementations of java.util.EventListener, and also in Swing packages
  • javax.faces.event.PhaseListener

Leave a Reply

Your email address will not be published. Required fields are marked *