Customizing the metamodel > Specifying key and keyed by properties > Examples of key and keyed by > One definition keyed by another
  
One definition keyed by another
Automobiles can be categorized by their “brand” and “model”. Create two definitions:
Car Brand: Including values such as Ford, Volkswagen, Toyota, and so on.
Car Model: Including values such as Mustang, Passat, and Corolla.
A “car model” must have its “car brand” (otherwise called its “Make”) specified. The car brand is a property that you can use to uniquely identify the car model; each car model has one and only one car brand.
You set “Make” to be a key property of “Car Model”, but in actuality it is “Car Brand” that is the definition type that is filled in for this property. You also make it REQUIRED, which means that to create the definition, you must fill in this property in the opening dialog to create the definition.
RENAME DEFINITION "User 1" To "Car Brand"
RENAME DEFINITION "User 2" To "Car Model"
DEFINITION "Car Brand"
{
PROPERTY "Country of Origin"
{ EDIT Text LENGTH 20 }
}
DEFINITION "Car Model"
{
Property "Make"
{KEY EDIT ONEOF "Car Brand" REQUIRED}
}
This example includes a problem in the USRPROPS.TXT, which is resolved in Creating a list of a keyed definition.
Next, see A third definition with two key properties.
See also
Examples of key and keyed by