Next: Layout area
Up: No Title
Previous: Triangle
A DJ program consists of several classes and optionally several constraint definitions. The body of each class is a sequence of class member declarations. Besides field declarations that declare member variables and method declarations that declare methods, a class member declaration may also be one of the following: dj-field declaration, constraint, or Action. Dj-field declarations declare the components that make up the class and the attributes of the class. Constraints are relations among components or component attributes. Unlike member variables in Java that can be updated, dj-fields are single-assignment variables whose values are determined automatically by the system based on the constraints over them. An action associated with a component specifies the action to take when some event happens to the component.
Unlike in Java classes, DJ classes do not have constructors. When an instance of a DJ class is created, its member components and attributes will be created automatically.
Neng-Fa Zhou
1999-02-16