Implementing OCL Invariants with Constrained Data Types

Alexander Paar

The Object Constraint Language (OCL) facilitates textual specifications of constraints that apply to Unified Modeling Language (UML) models. In particular, OCL is used for the specification of invariants in UML class diagrams. This paper compares the implementation of OCL invariants in program code by means of aspect-oriented programming (AOP) on the one hand and by means of value space constrained data types on the other hand. By contradistinction of these two approaches it will be argued that the availability of constraint-based type derivation and value space-based subtyping in a statically typed programming language can provide for the enforcement of OCL invariants already at compile time as opposed to runtime.

Download PDF (draft).

Related approaches (list is unordered and not exhaustive):
  •  K. Stirewalt and S. Rugaber. "Automated invariant maintenance via OCL compilation.", pdf
  •  S. Chiba. "Macro processing in object-oriented languages.", pdf
  •  D. Batory, V. Singhal, J. Thomas, S. Dasari, B. Geraci, and M. Sirkin. "The GenVoca model of software-system generators.", pdf
  •  S. Loecher and S. Ocke. "A metamodel-based OCL-compiler for UML and MOF.", pdf
  • ...

No comments:

Post a Comment