Well, tomorrow is round to me to give us a group of ways, just right, side, write essay ^ _ ^
The first is OBServer mode, personal feeling this mode is used to decouple two objects that are interconnected so they can be reused independently.
This mode is worth noting that the following aspects:
(1) Who will initiate a notice. It is automatically invoked when the Subject itself changes, or is called by the client. The former is relatively automatic, but the frequency of Update is relatively high; the latter is relatively passive, but the focus update of the observer after the Subject has changed multiple times.
(2) Users to establish the association between Subject and Observer. Yes from Subject :: Add (OBServer) or Observer :: Subcribe (Subject). I think it is better, because Subject doesn't have to know who it is Observer, and Observer must know who it wants to observe :)
(3) Subject can decompose. Subject = Entity ObserverableInterface, Entity is an entity, it has its features and nature, we assemble him the previous interface that can be used by observed, it turns into a Subject. Specifically, multiple inheritance, combination, and the like can be inherited.
(4) Well: I think this mode is the most bad place to hide Observer, can't see the OBServer behavior in the Client. However, maybe you will say this is the advantage of the OBServer mode ... I don't have it!