摘要
研究了委托与事件机制的实现方法,阐述了观察者模式的特征及所遵循的原则,提出了基于事件机制的观察者模式新的结构及编程框架。最后分析了其主要应用场景。
The observer pattern is mainly used to weaken the coupled relations between objects. The event mechanism buih on the basis of the delegate type further decouples subject and observer object of the observer pattern, improving the ability that the observer pattern can adapt to the changes better. This paper not only discusses implementation methods of delegate and event mechanism, but also ex- pounds the characteristics of observer pattern and principles, and then puts forward the new structure and programming framework of the event-based mechanism in observer pattern. In the end, it analyzes the main application scenarios.
出处
《重庆理工大学学报(自然科学)》
CAS
2012年第9期100-104,共5页
Journal of Chongqing University of Technology:Natural Science
基金
福建省教育厅科技项目(JA11265)
武夷学院科研基金资助项目(X1201019)
关键词
观察者模式
事件
委托
设计模式
observer pattern
event
delegate
design pattern