TIL Observer Pattern
POSTED ON:
TAGS: patterns
Observer Pattern #
Observer is a behavioral design pattern in which objects get information about any events happening to the object they are observing. The observer pattern defines a subscriber method, which will update every object that is subscribed to itself, making sure every subscriber gets the latest update.
An example of an observer in our daily life would be subscribing to a newsletter. The moment you join the mailing list you are notified when there is a new publication.
Use this pattern when changes on one object may require updating other objects, and the actual set of objects is unknown or changes dynamically.
Via Design Patterns for Web Development
Related TILs
Tagged: patterns