Skip to content

timmolderez/adbc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adbc - Design by Contract for AspectJ

adbc logo

Adbc is a small library that adds support for design by contract to the AspectJ programming language.
Released under the BSD 3-Clause license.

  • Add the library to your AspectJ project and contracts will automatically be enforced at runtime. Whenever a contract is broken, an exception is thrown which also indicates who is to blame.
  • Contracts are written as JavaScript expressions within Java annotations. (The library uses the JSR 223 API, so you can easily configure which scripting engine is used to evaluate the contracts.)
  • Contract enforcement is guided by behavioural subtyping and the advice substitution principle, which allows for modular reasoning. That is, you can reason about a method call just by looking at the contracts of the method body in the static type, even in the presence of advice. In a nutshell, to ensure that an advice complies with the advice substitution principle, its contracts should not interfere with those of the methods being advised. If an advice cannot avoid breaking the principle, modular reasoning can be0 restored by explicitly mentioning that advice's name in an @advisedBy annotation at each method it advises. (See the documentation for more information.)

Requirements

  • Java 6 (or later)
  • AspectJ (tested on versions 1.6.12 and 1.7.2)

Usage

When using Eclipse+AJDT, just add adbc.jar to your project's InPath and you can start writing contracts (using the annotations in be.ac.ua.ansymo.adbc.annotations). Contract enforcement is automatically enabled, and can be disabled if needed via the AdbcConfig class. For more information, be sure to have a look at adbc's documentation.

About

Design by Contract library for AspectJ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published