mirror of
https://github.com/CyC2018/Interview-Notebook.git
synced 2026-10-29 23:23:43 +00:00
Update 设计模式 - 观察者.md
重新绘制配图。
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 146 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 114 KiB |
+2
-2
@@ -6,7 +6,7 @@
|
||||
|
||||
主题(Subject)是被观察的对象,而其所有依赖者(Observer)称为观察者。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/7a3c6a30-c735-4edb-8115-337288a4f0f2.jpg" width="600"/> </div><br>
|
||||
<div align="center"> <img src="pics/observer-intent.png" width="740px"/> </div><br>
|
||||
|
||||
### Class Diagram
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
天气数据布告板会在天气信息发生改变时更新其内容,布告板有多个,并且在将来会继续增加。
|
||||
|
||||
<div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/b1df9732-86ce-4d69-9f06-fba1db7b3b5a.jpg"/> </div><br>
|
||||
<div align="center"> <img src="pics/observer-run.png" width="740px"/> </div><br>
|
||||
|
||||
```java
|
||||
public interface Subject {
|
||||
|
||||
Reference in New Issue
Block a user