摘要
为了解决面向方面编程中的方面冲突问题,在分析现有解决方法的基础上,提出了一种基于契约式设计的方面冲突自动检测方案。根据设计文档使用JML给方面和基础程序标注契约,利用契约转换程序生成契约检查程序,契约检查程序与面向方面的应用程序一起编译,生成包含契约检查的目标文件,从而在程序执行时,自动检测出方面与基础程序间的冲突以及方面与方面间冲突。该方案不破坏现有的应用程序,且无需重新设计编译器。通过一个实例表明该方案的可行性。
In order to solute the problem of aspects conflict in aspect-oriented programming, based on the design by contract, a solution of automatic checking to aspects conflict is proposed after analyzing the existed approach. JML (Java modeling language) is used to annotate contracts for base program and aspect based on design document. Contract checking program is created by contract transformation program, which is compiled with aspect oriented program by compiler, and the object files containing contract checking are created. The conflicts between base program and aspect and the conflicts between aspect and aspect are au tomatic found at run time. The solution in this paper need not modify aspect oriented application, and need not design new compiler. An example is given to prove the practicability of the solution at the end.
出处
《计算机工程与设计》
CSCD
北大核心
2012年第8期3064-3068,共5页
Computer Engineering and Design
基金
国家自然科学基金项目(60873024)
湖北省自然科学基金项目(2009CDB293)
关键词
面向方面编程
方面冲突
自动检测
契约式设计
Java模型语言
aspect-oriented programming
aspect conflict
automatic checking
design by contract
Java modeling language