【23种设计模式之】15.观察者模式

练习源码:https://github.com/liaoooyx/Design-Patterns

来自:https://www.baeldung.com/java-observer-pattern
Observer is a behavioral design pattern. It specifies communication between objects: observable and observers. An observable is an object which notifies observers about the changes in its state.

For example, a news agency can notify channels when it receives news. Receiving news is what changes the state of the news agency, and it causes the channels to be notified.

【23种设计模式之】15.观察者模式