COSI

The Constraint Sequencing Infrastructure (COSI) is an extension to the Common Lisp Object System (CLOS) which supports a constraint based object-oriented programming model. The CLOS Meta-Object Protocol (MOP) is used to specialize the behaviour of CLOS to support this model.

COSI has three core capabilities that support the constraint oriented paradigm: relationships, object management and constraint sequencing.

Relationships simplify the task of working with a network of objects. A relationship is a virtual bi-directional pointer between objects with arbitrary cardinality. By using a relationship, all objects in that relationship are aware of related objects, and the relationship is automatically maintained by the relationship manager as objects are added and removed.

The object manager is responsible for managing the instantiation of objects as they are created by constraints. Constraints specify the complete set of objects that should exist given some current state. If a constraint re-runs and creates an object that was instantiated with the prior invocation of the constraint, then the object manager returns the same object, rather than a new one. If a constraint re- runs and does not create an object that was created with the prior invocation then the object manager will delete the object, removing it from relationships and resetting its state.

A constraint is a specialized method which will be automatically re-run by the COSI infrastructure whenever any of its input values change. Input values are any of the object attributes that are accessed by the constraint, and which are therefore assumed to alter the processing within the constraint.

Whenever a state change occurs those constraints which depend upon that state are added to a propagation queue. When the system is queried a propagation cycle runs ensuring that the state of the system is consistent with all constraints prior to returning a value.

(from "COSI: Adding Constraints to the Object-Oriented Paradigm", The Trans Team, to be presented and published at the Lisp Users Group meeting, October 1999.)

Related:


Is the COSI source code available anywhere?

This page is linked from: computed-class   Garnet   KR  

CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively