Connecting two objects in the same class

At times you may need to connect members of the same class to each other. For example, in a Gene class you might express notions such as "gene x is similar to genes y, z, and q", "see also gene m", and "the other name for gene r is s".

An example of this in ?TShirt is

          Resembles ?TShirt
If this self-referencing structure is confusing, consider it from the data point of view. Suppose we enter the information

TShirt : sam19
Resembles sam25
ACEDB will create sam19 and sam25 (if they don't already exist) and in the field following sam19's "Resembles" label. A user examining sam19 can now traverse the link to sam25 to find out more about it (assuming sam25 is not empty).

The structure above permits a simple, one-way link. However, a two-way link makes better sense from the user's point of view since if x resembles y, then y should resemble x. We could use XREF:

          Resembles ?TShirt XREF Resembles
Again the data above causes ACEDB to create TShirt sam19 but now it also activates sam19's XREF. The XREF targets sam25:

Synonyms can be handled in the same way. However, a strategy that clearly identifies one object as having the "correct" or "official" name is:

?Store Sometimes_called ?Store XREF Official_name
       Official_name ?Store XREF Sometimes_called
If you adopt this structure remember to use the object with the official name as the container for the data; the other objects should just contain links back to the "correct" one. This avoids forcing users to examine multiple objects to obtain a complete understanding of an object. For example, we might enter

Store : "Wolf's DryGoods"
Sometimes_called "Wolf's"
Address "2000 Main St., Salt Lake City, UT 84103"
The object called "Wolf's DryGoods" will contain an address; the object named "Wolf's" just points to "Wolf's DryGoods", thus helping the user who does not know the "correct" name for the store.


Show me the whole t-shirt model again.

Back to Table of Contents