Previous Topic: Defining Employee and Its Attributes

Next Topic: Defining the Employee Entity

Defining the Employee Attributes

The next step in defining Employee is to add triples for Employee’s attributes to inherit structure and functionality from class library fields.

  1. In the Model Editor, add the following triple:

    Employee ID is a OBASE/Code

    Note: The is a verb you use in this step is different from the one that you used in the previous section. There are several verbs that have the same name, but which have a different target object. Make sure to select the verb that matches the target object (in this step, the is a FLD verb).

    For more information on OBASE/Code, see To Define the Properties of Project’s Fields in this chapter.

  2. Add the following inheritance triples:

    Employee Name is a OBASE/Narrative
    Employee Email is a OBASE/Narrative
    Employee URL is a OBASE/Narrative

    Inheriting from OBASE/Narrative gives each of these fields a length of 25.

    These fields may require more than 25 characters to store the whole name, email address, or URL. One of the powerful aspects of inheriting from class libraries, though, is that you can change the default values.

  3. Add the following triples to increase the field lengths (the numbers are displayed in red because they are literal values):

    Employee Name length 40
    Employee Email length 50
    Employee URL length 50

    By adding these three triples, you effectively changed the database schema, the user interface, and all of the processing for these values to use a different length for each field.

  4. Add the following triple:

    Employee Billing Rate is a OBASE/Price

    Inheriting from Price causes Employee Billing Rate to store a number with two decimal places.