从学通信的博士到从事IT行业的工程师 从原华为项目经理,到现任职公司架构师
分类: C/C++
2012-12-23 20:35:22
The observer pattern lets you vary subjects and observers independently. Normally the observers don't know existence of each other. Who will trigger the notification? I prefer to the client because the service is clear here. Certainly the subject can also do it.
Observers can only subscribe some aspects of one subject. Change-manager is used to maintain the mapping between the subjects and observers.