设计模式 - JDK 自带的观察者模式
文章目录
- 设计模式 - JDK 自带的观察者模式
- 1、被观察者
- 2、观察者接口
- 3、定义被观察者:灯
- 4、定义观察者
- 5、构建观察现象
设计模式 - JDK 自带的观察者模式
1、被观察者
package java.util;
/** * This class represents an observable object, or "data" * in the model-view paradigm. It can be subclassed to represent an * object that the application wants to have observed. * <p> * An observable object can have one or more observers. An observer * may be any object that implements interface <tt>
还没有评论,来说两句吧...