摘要
分析了观察者(Observer)设计模式的各组成部分和应用场景,探讨了Java事件处理机制的原理以及事件源、事件、监听器与观察者设计模式中各角色的对应关系,给出了利用观察者模式实现Java事件处理机制的三种方式并分析了各自的优缺点。
Analyzed the composition of each part of the Observer design pattern and its application scenarios,explored the correspondence between Java event handling mechanism of principle as well as the source of event,event,event listener with the Observer design pattern role.Given three ways of the use of Observer mode to achieve the mechanism of the Java event handling and analyzed their respective advantages and disadvantages.
出处
《微处理机》
2013年第4期77-79,共3页
Microprocessors
基金
陕西省教育厅专项科研计划项目(09JK811)
关键词
观察者模式
事件源
事件
监听器
事件处理机制
Observer Design Pattern
Event Source
Event
Listener
Event Handling Mechanism