May 2019
Beginner to intermediate
548 pages
12h 39m
English
The observer pattern consists of an object that we call the observed object, and a number of observer objects. There is a one-to-many relationship here. The object is observed by the data manager, who informs all the observers about changes in the data that it contains. It is the only rightful owner of this data.
When observers get information that the data has changed, they collect it from the observed object and update the data of the observers. The observer itself can decide whether it wants to continue observing an object, but the observed object can also remove it from the list of observers. The observer does not know any other observers; they are independent of each other. Any modification of one observer ...
Read now
Unlock full access