December 2018
Intermediate to advanced
512 pages
8h 51m
English
This chapter covers the observer pattern.
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
In this pattern, there are many observers (objects) that are observing a particular subject (also an object). Observers register themselves to a subject to get a notification when there is a change made inside that subject. When they lose interest of the subject, they simply unregister from the subject. It is also referred to as the publish-subscribe pattern . The whole idea ...