You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
观察者模式
|
|
|
|
|
|
|
|
当观察对象发生变化时,会通知观察者。观察者模式使用于根据对象状态对应处理的场景
|
|
|
|
|
|
|
|
Observer 本来的意思是"观察者" ,但实际上Observer角色并非主动地去观察,而是被动的接受 subject的通知
|
|
|
|
因此观察者模式有被称为 publish-Subscribe(订阅-发布)模式.
|