The document discusses several design patterns including Observer, Singleton, Adapter, Facade, Template Method, Iterator, and Composite. It provides details on the Observer pattern which defines a subscription mechanism so that multiple observer objects are notified of any changes to a subject object. It also notes how objects can register and unregister as observers to be notified of subject state changes.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
40 views
Design Pattern
The document discusses several design patterns including Observer, Singleton, Adapter, Facade, Template Method, Iterator, and Composite. It provides details on the Observer pattern which defines a subscription mechanism so that multiple observer objects are notified of any changes to a subject object. It also notes how objects can register and unregister as observers to be notified of subject state changes.
9 Well-managed Collections: the Iterator and Composite Patterns 315-385 70 page
Observer Desing Pattern
The intent of an observer pattern is to define a one-to-many dependency so that
when one object (i.e. the publisher) changes its state, all its dependents (i.e. all its subscribers) are notified and updated correspondingly Is notified when some events haapen
Register with the subject
Note: You have unregistered with observer1 Now only Observer 2 will get the notification.