Observer
Implementation
Several issues related to the implementation of the dependency mechanism are discussed in this section.
-
-
-
-
Dangling references to deleted subjects.
Deleting a subject should not produce dangling references in its
observers. One way to avoid dangling references is to make the
subject notify its observers as it is deleted so that they can reset
their reference to it. In general, simply deleting the observers is not
an option, because other objects may reference them, or they may be
observing other subjects as well.