OWNER ?TShirt Borrowed_by ?Person XREF TShirt TARGET ?Person TShirt ?TShirtActivate the XREF with the following data:
TShirt : sam15 Borrowed_by SarahAs per the XREF rules, ACEDB looks for Sarah in the Person class and fills in "sam15" following the "TShirt" label. Remember that if Sarah does not yet exist, ACEDB will create a Person with this name. Reusing the diagram from the previous section:
In Sam15, enter data "Sarah"--------
into field ?Person XREF TShirt |
|
|
|
OWNER -----?TShirt Borrowed_by ?Person XREF TShirt
Sam15 | | |
| | |
| 1. Find | |
| --------------------- |
| | Person Sarah |
| | |
| | |
| | 2. Find |
| | --------------------------
| | | label TShirt
| | | in Person Sarah
| | |
| | |
TARGET | ?Person TShirt ?TShirt
Sarah | |
| |
| |
| 3. Message: |
-------------------------
Put TShirt Sam15
into ?TShirt field
in Person Sarah
Because XREF automatically fills out the ?TShirt field in Person
Sarah, it is as if this data had been entered in the first place:
TShirt : sam15 Borrowed_by Sarah Person : Sarah TShirt sam15 //**Gratis!!The major advantage of XREF is that it fills out the other side of the two-way link--meaning the curator doesn't have to. With XREF there is no risk of intending to establish a two-way link and then forgetting to fill out both sides; this is always a danger without XREF.
Person : Sarah TShirt sam55In this case the software creates a TShirt class member called "sam55" (if it does not already exist)--but that is all. The link from ?Person to ?TShirt is ordinary; there is no XREF to fill out a field in ?TShirt automatically. Specifically, this field in ?TShirt:
Borrowed_by ?Person XREF TShirt is not filled out, and this means that a one-way link has been established, not a two-way link. Thus
an XREF is required for an object to send its name to a target.It is possible to establish a symmetrical relationship by using XREFs on both sides of a link. This is considered in the next section.
Back to Table of Contents