Adding a Reference Property
Use the Add Reference command from the Properties menu to add a new static reference to the selected class. You can add a reference to the selected class at any time. (For details about adding a dynamic reference, see "Defining a Dynamic Reference Property" under "Dynamic Clusters and Properties".)
A reference is a property that contains a reference to another object; that is, it is an end point in a one- or two-directional relationship. The two types of reference are:
-
An implicit reference, in which an object references another object and either of the following is true:
-
The reference object does not contain a reference back to the first object.
-
The referenced object contains a reference to the first object but the two properties have not been defined as end points in a two-way relationship by using the Define Inverse button on the Define Reference dialog.
-
-
An inverse (or explicit) reference, in which two objects reference each other and the two properties have been defined as end points in a two-way relationship by using the Define Inverse button on the Define Reference dialog.
The advantage of using an inverse relationship instead of an implicit relationship is that one side of an inverse relationship can be maintained automatically by JADE.
For details about using condition constraints to maintain automatic inverse references when the specified conditions are satisfied, see "Defining and Compiling JADE Methods and Conditions" and "Adding Conditions to Classes or Primitive Types", earlier in this chapter.
To add a reference property
-
In the Class Browser, select the class to which the reference is to be added.
-
Select the Add Reference command from the Properties menu.
The Define Reference dialog, shown in the following image in an example of its initial form, is then displayed.
An extended form of the dialog is displayed when you specify that you want to define an inverse reference. For details, see "Defining an Inverse Reference Property", later in this chapter.