期刊文献+

中介者模式的面向方面实现

IMPLEMENTATION OF MEDIATOR PATTERN BASED ON AOP
下载PDF
导出
摘要 中介者模式常被应用于多个对象需要交互的场合。使用传统的面向对象技术的实现方案容易导致代码分散,冗余代码多,可维护性低。使用面向方面技术实现中介者模式的方案,用方面来表达中介者对象,并把构建模式的同事对象所需要的代码也封装到方面中,对象的交互则使用切入点的定义与通知来实现。与传统实现方案相比,基于面向方面技术的实现方案具有代码集中、可读性强、可扩展性强等优点。 Mediator pattern is usually used in the case of interaction of more than one object. The object-oriented implementation of mediator pattern may easily lead to code scattering, heavy code redundancy and lower maintainability. A method based on aspect-oriented programming(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 with the traditional implementation, AOP-based method is more code-concentrating, extensible and readable.
出处 《计算机应用与软件》 CSCD 北大核心 2008年第11期46-47,111,共3页 Computer Applications and Software
基金 国家自然科学基金项目(60673050)
关键词 面向对象 方面 AOP 设计模式 中介者模式 Object-oriented Aspect Aspect-oriented programming Design patterns Mediator pattern
  • 相关文献

参考文献6

  • 1Gamma, Helm, Johnson, Vlissides. Design Patterns : Elements of Reusable Object-Oriented Software[ M ] Boston:Addison-Wesley, 1995.
  • 2Gamma, Helm, Johnson, Vlissides. Design patterns : abstraction and reuse of object-oriented design [ J ]. New York : In : Manfred Broy and Ernst Denert Eds. Software pioneers:contributions to software engineering, Spring-Verlag,2002:701 - 717.
  • 3Kiezales G, et al. Aspect-Oriented Programming [ J ]. Finland : In: M. Aksit and S. Matsuoka Eds. , ECOOP' 97, LNCS, 1997, 1241 : 220 - 242.
  • 4Joseph D Gradecki, Nicholas Lesiecki.精通AspectJ[M].王欣轩,吴东升,等译.清华大学出版社,2005.
  • 5Adrian Colyer, Andy Clement, et al. Eclipse AspeetJ [ M ].钱竹青,邹正武,等译.清华大学出版社,2006.
  • 6Jan Hannemann, Gregor Kiczales. Design Pattern Implementation in Java and AspectJ[ J] Proceeding OOPSLA'02.ACM SIGPLAN Notices, 2002:161 - 173.

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部