首页 | 本学科首页   官方微博 | 高级检索  
     

应用AOP技术实现Observer模式
引用本文:郭丽丽,王清心,胡建华,丁家满.应用AOP技术实现Observer模式[J].微机发展,2007,17(6):70-73.
作者姓名:郭丽丽  王清心  胡建华  丁家满
作者单位:昆明理工大学信息工程与自动化学院 云南昆明650051
基金项目:联合国计划发展署UNDP403项目资助
摘    要:Observer模式被人们广泛应用(特别是在GUI应用程序中),并构成了MVC架构的关键部分。它处理复杂的问题,而在解决这类问题方面表现得相对较好。但面向对象的Observer模式实现方案中,要求先侵入系统中现有的类,然后才能支持该模式,带来了以下问题:难以理解、可重用性差、后期维护很复杂、代码不容易组合等。基于AOP技术,提出了一种可重用的Observer模式的方案,并通过与面向对象实现方案的比较,得出了AOP技术实现方案具有模块松散耦合、可重用性高等优点的结论。

关 键 词:AOP  Observer  Pattern  AspectJ
文章编号:1673-629(2007)06-0070-04
修稿时间:2006年8月19日

Implementation of Observer Pattern with AOP
GUO Li-li,WANG Qing-xin,HU Jian-hua,DING Jia-man.Implementation of Observer Pattern with AOP[J].Microcomputer Development,2007,17(6):70-73.
Authors:GUO Li-li  WANG Qing-xin  HU Jian-hua  DING Jia-man
Abstract:Observer pattern is the most common design pattern(especially in GUI application),and is the key part of the MVC model.However,there are some inherent flaws in the implementation of observer pattern with OOP,such as invade the class of the present system,then support this pattern,hard to understand,bad reusable,complex maintenance,not easy to composite.A reusable method to implement observer pattern based on AOP technology was presented.Compared with the object-oriented method,the advantages of AOP were addressed.
Keywords:AOP  observer pattern  AspectJ
本文献已被 CNKI 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号