计算机应用 ›› 2005, Vol. 25 ›› Issue (03): 620-622.DOI: 10.3724/SP.J.1087.2005.0620

• 软件技术 • 上一篇    下一篇

利用产生式编程构建低耦合的软件模块——AOP的原理和实践

张强1,谭博2,谭成翔1   

  1. 1.同济大学计算机科学与工程系; 2.复旦大学软件学院
  • 出版日期:2005-03-01 发布日期:2005-03-01

Implementing low-coupling module with generative programming methods: the theory and practice of AOP

ZHANG Qiang1, TAN Bo2, TAN Cheng-xiang1   

  1. 1.Department of Computer Science and Engineering, Tongji University, Shanghai 200092, China; 2.School of Software Engineering, Fudan University, Shanghai 200433, China
  • Online:2005-03-01 Published:2005-03-01

摘要:

分析了面向对象理论遇到的难以解决的问题。针对此类问题提出了利用产生式编程构建通用领域模型和低耦合的模块的思想。以AspectOrientedProgramming(AOP)为例,列举了其主要实现手段,分析了它们的利弊,对比了传统OO方法的Observer模式实现和利用AOP的Observer模式实现。

关键词: 产生式编程, AOP, 复用, 设计模式, 横切关注点

Abstract:

With the development of programming technology and theory, some problems in practice, which can not be solved by the traditional OO theory, are attracting more and more interests of researchers. A generative programming-based approach was proposed to solve such kind of problems by constructing domain-neutral models and low-coupling modules. One implementation of our proposed approach, AOP, was analyzed to demonstrate the advantages and shortcomings of our approach. Finally, a comparison between AOP-based and OO-based Observer models was conducted to show the superiority of our approach over traditional OO approaches.

Key words: generative programming, AOP, reuse mechanism, design pattern, crosscut

中图分类号: