jContractor: A Reflective Java Library to Support Design by Contract

  • Authors:
  • Murat Karaorman;Urs Holzle;John Bruno

  • Affiliations:
  • -;-;-

  • Venue:
  • jContractor: A Reflective Java Library to Support Design by Contract
  • Year:
  • 1999

Quantified Score

Hi-index 0.00

Visualization

Abstract

jContractor is a purely library and design-pattern based approach to support Design By Contract specifications such as preconditions, postconditions, class invariants, and recovery and exception handling in Java. jContractor uses an intuitive naming convention, and standard Java syntax to instrument Java classes and enforce Design By Contract constructs. The designer of a class specifies a contract by defining protected methods which conform to the jContractor design patterns. jContractor uses Java Reflection to synthesize an instrumented version of a Java class containing jContractor contract specifications. The instrumented version contains code which enforces the Design By Contract specifications. Programmers enable the run-time enforcement of contracts by either incorporating the jContractor class loader or by instantiating  objects directly from the instrumented subclass through the jContractor  factory. Programmers can use exactly the same syntax for invoking methods and passing object references regardless of whether contracts are present or not. Since jContractor is purely library-based, it works with any Java implementation and requires no special tools such as modified compilers, modified JVMs, or pre-processors.