Features
Specification of Preconditions, Postconditions and Invariants
» Direct assignment to classes, constructors and methods on source code level by Annotations
» Recognition of inherited Contracts (deep inheritance)
» Recognition of Contracts on implemented Interfaces (deep inheritance, multi-inheritance)
» Support for ad hoc instantiations for beans not defined in Springs Application Context due to Load Time Weaving
» External Declaration and assignment of Contracts via Spring Application Context
(Spring 2.0 NamespaceHandler for concise declaration).
» Extensible, configurable mechanism by providing and injecting custom types of ContractElementAttributeSources
» Definition of Messages in case of Contract Violations. Can
reference surrounding context (class, args, return value, ...)
Configurable behaviour of Contract Validation
» Selective Deactivation of Recognition and Evaluation of Preconditions, Postconditions or Invariants on different levels.
»
Configurable behaviour how to react on Contract Violations (i.e.
throwing Exceptions, Logging, Spring Application Event, ...)
» Extensible, by providing and injecting custom ContractViolationHandlers
Exchangeable Specification Language
» Extensible, configurable mechanism for switching the underlying Specification Language
(i.e. EL (Commons EL), MVEL, OGNL, Groovy, Java/Beanshell)
» Extensible, by providing and injecting a Custom ContractBuilder
» Build-In Language extensions due to first order logic (exist quantor, all quantor, implication)
Named Constraints
» Support for Definition of (generally domain specific) Constraints at a higher domain level
» Global available - can be referenced via symbolic names in any Precondition, Postcondition or Invariant
» Support for projection - instantiation of arguments with
concrete values of calling context (i.e. method args, class props, ...)
|