Previous Topic: Defining Field Properties

Next Topic: Using Continuation Triples to Make Fields Optional

More About Field Inheritance

The fields you defined in the previous section have two different data types: character and date. These represent different kinds of fields:

Currently, your model only indicates that those fields exist, and that they belong to the Project entity, but has no information about what type of data they store.

Inheritance is the mechanism that enables an object to adopt the properties of another more general (or abstract) object.

By inheriting from pattern library fields, you enable your application to:

To define the properties of Project’s fields:

  1. Make sure that the Object Browser is focused on fields, and that library objects are showing (click the Show/Hide Library Objects button to display library objects and the Fields button to display field objects).
  2. Select the Project ID field in the Object Browser by clicking on the name (not the icon to the left of the name) and drag the field from the Object Browser to the source object box of the Model Editor.

    This changes the Model Editor source object type to Field, and changes the verb list so that only verbs appropriate for fields are contained in it.

    Note: The cursor changes to a closed parcel icon when you drag an object. It changes to an open parcel icon when it is over a location where you can drop the object:

    Closed Parcel Icon

    Open Parcel Icon

    PLEX--More About Field Inheritance (2)

  3. From the verb list, select is a FLD.
  4. From the Object Browser, drag the library object FIELDS/Identifier field to the target object box, and press Enter.

    Note: You have to scroll down in the Object Browser to find the FIELDS/Identifier field. You can use the filter box at the top of the Object Browser to only show some of the library items. In this case, you could type *Identifier* to display only FIELDS/Identifier. Remember to set the filter back to * when you are done.

  5. You just created the triple Project ID is a FIELDS/Identifier. Click the Refresh button on the Object Browser. Notice that the Project ID field has a plus sign to the left, indicating that it now has scoped objects.

    PLEX--More About Field Inheritance (4)

  6. Click the plus sign to expand the field:

    PLEX--More About Field Inheritance (3)

    Values are another type of CA Plex object. You can see that Project ID now has the value *Blank, but you cannot tell much else about what it inherited from FIELDS/Identifier.

  7. Drag the Project ID field from the Object Browser to the body of the Model Editor. The body is the bottom part of the editor, where the full triples are displayed.

    When you drag one or more objects to the body of the Model Editor, the display changes to show you only the triples that define those objects. This is called focusing the Model Editor. When you drag the Project ID field to the Model Editor, it focuses on this field, showing the triple Project ID is a FIELDS/Identifier. This still does not tell you much.

  8. To see more about what an object inherits from its ancestor objects, click the Two Levels toolbar button.

    PLEX--More About Field Inheritance (6)

    The Model Editor shows another level of detail.

    PLEX--More About Field Inheritance (5)

    Now you can see that Project ID has inherited a data type of character and length of 10, along with the value *Blank (which you saw in the Object Browser in Step 6).

    Note: In Step 4, you dragged the library object FIELDS/Identifier from the Object Browser to the target object box in the Model Editor. You can actually enter the name of the object into the target object box (without the library name) to accomplish the same thing. In step 4, you would have entered Identifier.

    A word of caution: if you entered a wrong object name, you could create a new object with the wrong name. If you do this, find the erroneous object in the Object Browser and delete it.

  9. Click the One Level toolbar button to set the Model Editor to show a single level of information.

    PLEX--More About Field Inheritance (7)

  10. Reset the Model Editor display by clicking the Clear Focus button. This displays all of the triples in the model, again:

    PLEX--More About Field Inheritance (9)

    PLEX--More About Field Inheritance (8)

    More About Field Inheritance (14)

    If your Model Editor displays a lot more triples than shown in the previous graphic, you have your model set to display library objects. If this is the case, click the Show/Hide Library Objects toolbar button.

  11. Drag the Project Description field from the body of the Model Editor to the source object box. This field is in the third column of the Project has Project Description triple.
  12. Enter LongDescription in the target object box, and press Enter.

    Notice that the Model Editor displays the triple as:

    Project Description is a FIELDS/LongDescription

    This indicates that you correctly spelled the name of the pattern library field.

    Note: If you create a new object for a model, and it happens to share the name of a library object, you must rename your object or delete it (if you did not intend to create it).

  13. Repeat Steps 2-4 or Steps 11-12 to create the following triples:

    Project Start Date is a DATE/CheckedDateISO
    Project End Date is a DATE/CheckedDateISO

  14. Click the Refresh toolbar button on the main toolbar (not on the Object Browser). Your Model Editor should look like this:

    PLEX--More About Field Inheritance (16)

    Inheriting from DATE/CheckedDateISO gives the fields functionality to ensure that end users enter valid dates.

  15. Use the process explained in Steps 7 and 8 to look at the characteristics that these fields inherit from the Pattern Library fields.