Composition ?Country #Components
The label "Composition" is followed by two fields. "?Country" is an
ordinary class of the sort we have already considered, and
"#Components" is a constructed type. The model assumes that we have
already defined ?Country (we won't show it here) and the ?Components
class which perhaps looks like this:
?Components Dye Text ?Manufacturer
Cloth Text ?Manufacturer
Although a constructed type looks like a single indivisible field, it
is really much more. Think of a constructed type field as representing
an entire class that can be grafted like an extension onto other
classes, even to several places in the same class. The #XXXXX is in a
sense an abbreviation for the graft. The extension can be as complex
as an "ordinary" class with multiple labels, fields, and links.
TShirt : sam29 Composition France Dye Orange-22 DuPont Composition Mexico Dye Red-15 DuPont Composition Canada Dye Blue-08 Monsanto Composition Brazil Cloth Cotton CannonLook carefully at the data syntax. It contains a feature you have not seen elsewhere: data and labels are interspersed. Nonetheless this syntax follows the more general rule that data entry requires a label to position the incoming data properly; i.e., data is presented in a label--data pair which allows ACEDB to locate the appropriate field for the data. When a constructed type is grafted onto a model this rule still holds and one must specify labels if the structure of the constructed type requires them.
The resulting display (which we have scrolled slightly to the right) is:

Notice that the interspersed labels appear in the display. For example, both "Composition" and "Dye" are labels; sandwiched between them is "France" which is data. Interspersed labels can be very helpful to users who might otherwise be confused by a series of ambiguous fields. You cannot accomplish this with an "ordinary" model, e.g. using the structure:
Composition ?Country Dye Text ?Manufacturer //***WRONG***
Cloth Text ?Manufacturer //***WRONG***
Composition Body #Components
Lining #Components
This circumvents another restriction, namely that labels can be used
only once per class definition since now the labels "Dye" and "Fabric"
can appear in two different contexts.
Background Red
Green
Purple
Grey
Blue
can be profitably rendered
Background #Color
where ?Color is defined as
?Color Red
Green
Purple
Grey
Blue
Back to Table of Contents