Design Patterns for the Implementation of Constraints on JavaBeans

Holger Knublauch, Martin Sedlmayr, Thomas Rose · 2000

. Although constraints are useful to express semantic restrictions on object structures, Java provides little support for their implementation and evaluation. We argue that constraints should be specified explicitly, and propose a set of design patterns for the representation of constraints on JavaBeans. Object-oriented reflection is used to evaluate these constraints at run-time. We show how this technology can be used to support data and knowledge acquisition, and system evaluation. 1 Introduction Constraints are meta-data about the semantic restrictions that are assumed to be satisfied in a given set of objects. For example, constraints can restrict the range of an object's integer attribute or the maximum cardinality of an array. Constraints are useful to document and communicate the semantics of classes, to validate the correctness of object states at run-time, to repair inconsistent data structures, and for various types of reasoning. Although constraints are assumed to...

Read the paper · More papers on PaperTik