Two-way connections using XREF

A method for automatically establishing two-way links is provided by the XREF mechanism. Since this is one of the most important features in ACEDB it will be considered in detail.

In ?TShirt, an XREF appears in

             Borrowed_by ?Person XREF TShirt
"?Person XREF TShirt" is a single field even though only one of its components is a class name. "XREF" and "TShirt" provide additional instructions to the database describing what to do when this field accepts data. The interpretation is:

  1. find the Person object named in the "Borrowed_by" field.
  2. find the label "TShirt" in that object.
  3. fill out field following the label with the name of the TShirt.
Instruction 2 makes an assumption about the ?Person model, namely that it contains a label called "TShirt". Instruction 3 assumes the label is followed by a field that can accept the name of a ?TShirt member. Here is a ?Person model consistent with these requirements:

?Person  TShirt ?TShirt
         Relationship Friend
                      Relative

Owner and Target

XREF action can be stated in terms of owner and target objects:

The object which "owns" the XREF sends a message--the owner's name--to a target object, directing it to store the owner's name in a particular field. The message is triggered when the owner's XREF receives data. The net result is that the target now has a link back to the owner.
The relationship between owner and target is shown in the diagram below:


 OWNER     -----?TShirt Borrowed_by ?Person XREF TShirt
           |                           |           |
           |                           |           |
           |            1. Find        |           |
           |       ---------------------           |
           |       |   this ?Person                |
           |       |                               |
           |       |                               |
           |       |               2. Find         |
           |       |      --------------------------
           |       |      |      label TShirt
           |       |      |
           |       |      |
           |       |      |
 TARGET    |    ?Person TShirt ?TShirt
           |                      |
           |                      |
           |                      |
           |   3. Fill in field   |
           ------------------------
               with TShirt name

The link described above is asymmetric because the XREF appears on only one side of the link. The next section contains examples showing how this link behaves when data is provided.


Show me the whole t-shirt model again.

Back to Table of Contents