Contractual Development is a kind of developing methodology which draws on the merits of Formal Method,and is easy to be put into practice.However,its traditional programming language,Eiffel,is very difficult to learn and popularize.This paper presents a model which,on basis of object - oriented programing Language, can use aspect - oriented programing method to carry out contractual constraint inspections.Taking Java object - oriented programing language as an example,this paper uses AspectJ to carry out a contractual constraint inspections on Java's interface,class,inheritance,data types,constructors,regions,methods,and exception increased concerns,etc.,and creates a developing language environment which has contractual function and is easy to be put into practice.%契约式开发方法是一种借鉴了形式化方法的优点而又易于实践的开发方法学,然而Eiffel等传统的契约式编程语言难以学习与推广。本文提供了一种模型,该模型利用面向方面的编程技术,在面向对象程序设计语言基础上,增加了契约式约束检查。并以Java面向对象程序设计语言为例,使用AspectJ技术对Java程序中的接口、类、继承、数据类型、构造器、域、方法、异常增加关注点,进行契约约束检查,最终形成一种易于实践且具有契约式功能的开发语言环境。
展开▼