The Observer design pattern is used for state change notifications. An object called subject (or publisher) has a list of dependents, called observers (or subscribers). When the subject changes state, all its dependents are notified by calling a method. The Observer pattern is useful for the implementation of event handling.
The observer interface has an abstract method used for notifications and the subject has methods for attachment and detachment of observers.
(more…)