Predicate Classes
Craig Chambers
Predicate classes are a new linguistic construct designed to
complement normal classes in object- oriented languages. Like a normal
class, a predicate class has a set of superclasses, methods, and
instance variables. However, unlike a normal class, an object is
automatically an instance of a predicate class whenever it satisfies a
predicate expression associated with the predicate class. The
predicate expression can test the value or state of the object, thus
supporting a form of implicit property-based classification that
augments the explicit type-based classification provided by normal
classes. By associating methods with predicate classes, method lookup
can depend not only on the dynamic class of an argument but also on
its dynamic value or state. If an object is modified, the
property-based classification of an object can change over time,
implementing shifts in major behavior modes of the object. A version
of predicate classes has been designed and implemented in the context
of the Cecil language.
ECOOP'93 Conference Proceedings, Kaiserslautern, Germany, July, 1993.
To get the PostScript file, click
here.
Cecil/Vortex
Project