Intent: Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.Examples: auctor, bidders and the bid soccer players, referee and the soccer temperature/pressure and the monitors data and the viewsStructure:示例:温度和压力监测器需要实时更新数据通知显示器,显示器是电脑上的GUI图形窗口,和现场液晶大屏幕。压力和温度就是Subject,电脑和大屏幕是Observer。C++ Code:
posted on 2010-08-01 20:29 挑灯看剑 阅读(354) 评论(0) 编辑 收藏 引用 所属分类: 架构设计/设计模式
Powered by: IT博客 Copyright © 挑灯看剑