0% 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.
Copyright
© Attribution Non-Commercial (BY-NC)
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% 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.
Copyright
© Attribution Non-Commercial (BY-NC)
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
You are on page 1/ 13

2 Keeping your Objects in the know: the Observer Pattern 37-78 42page 5 days

5 One of a Kind Objects: the Singleton Pattern 169- 191 22 page

7 Being Adaptive: the Adapter and Facade Patterns 235-275 36 page

8 Encapsulating Algorithms: theTemplate Method Pattern 275-314 40 page

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.

2
3
Factory Design
Adapter Pattern

You might also like