FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Unity3DTraining/DesignPatterns/ObserverPattern at master · XINCGer/Unity3DTraining · GitHub
XINCGer
/
Unity3DTraining
Public
Notifications
You must be signed in to change notification settings
Fork
2.1k
Star
9.1k
Code
Issues
6
Pull requests
1
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Unity3DTraining
/
DesignPatterns
/
ObserverPattern
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
Breadcrumbs
Unity3DTraining
/
DesignPatterns
/
ObserverPattern
/
Copy path
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
ObserverPattern
ObserverPattern
ObserverPattern.sln
ObserverPattern.sln
README.md
README.md
README.md
Outline
观察者模式
定义
观察者模式定义了一种一对多的依赖关系,让多个观察者对象同时监听某一个主题对象。这个主题对象在状态模式发生改变时,会通知所有观察者对象,使它们能够自动更新自己。
小结
观察者模式适用于以下几种情况:
当一个抽象模型有两个方面,而其中一个方便必须依赖于另外一个方面时;
当对一个对象的改变需要同时改变其他的对象但是却不知道具体有多少个对象等待改变时;
当一个对象必须通知其他对象但是却不能与其他对象造成紧密耦合时。
Back
|
FazBrowse Home
|
New Git URL