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

中介者模式的面向方面实现
引用本文:罗达,张远舟,周晓聪. 中介者模式的面向方面实现[J]. 计算机应用与软件, 2008, 25(11)
作者姓名:罗达  张远舟  周晓聪
作者单位:中山大学计算机科学与技术系,广东,广州,510006;中山大学计算机科学与技术系,广东,广州,510006;中山大学计算机科学与技术系,广东,广州,510006
摘    要:中介者模式常被应用于多个对象需要交互的场合.使用传统的面向对象技术的实现方案容易导致代码分散,冗余代码多,可维护性低.使用面向方面技术实现中介者模式的方案,用方面来表达中介者对象,并把构建模式的同事对象所需要的代码也封装到方面中,对象的交互则使用切入点的定义与通知来实现.与传统实现方案相比,基于面向方面技术的实现方案具有代码集中、可读性强、可扩展性强等优点.

关 键 词:面向对象  方面  AOP  设计模式  中介者模式

IMPLEMENTATION OF MEDIATOR PATTERN BASED ON AOP
Luo Da,Zhang Yuanzhou,Zhou Xiaocong. IMPLEMENTATION OF MEDIATOR PATTERN BASED ON AOP[J]. Computer Applications and Software, 2008, 25(11)
Authors:Luo Da  Zhang Yuanzhou  Zhou Xiaocong
Affiliation:Luo Da Zhang Yuanzhou Zhou Xiaocong (Department of Computer Science,Sun Yat-sen University,Guangzhou 510006,Guangdong,China)
Abstract:Mediator pattern is usually used in the case of interaction of more than one object.The object-oriented implementation of media- tor pattern may easily lead to code scattering,heavy code redundancy and lower maintainability.A method based on aspect-oriented program- ming(AOP) is proposed to implement the mediator pattern,in which the mediator object is represented by an aspect.The colleague object is also encapsulated in the aspect and the object interaction is realized via pointcut and advice.Comparing wit...
Keywords:AOP
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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