Observer pattern

定义了对象之间的一对多依赖,这样一来,当一个对象改变状态时,它的所有依赖者都会收到通知并自动更新。
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

Observer pattern is used when there is one-to-many relationship between objects such as if one object is modified, its depenedent objects are to be notified automatically. Observer pattern falls under behavioral pattern category.

The observer pattern is a software design pattern in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. For more

Observer Pattern Tutorial with Java Examples
The Observer Pattern in Java

Java内置的观察者模式:
java.util.Observable
java.util.Observer

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wwq518/article/details/51549409
个人分类: Design Pattern
相关热词: observer
上一篇BeanFactory or ApplicationContext in Spring
下一篇WeakReference vs SoftReference vs PhantomReference vs StrongReference
博主设置当前文章不允许评论。

没有更多推荐了,返回首页

关闭
关闭