Caché QuickStart Tutorial
Exercise: Creating the PhoneNumber Class
[Back] [Next]

Now let's further enhance the application to include phone numbers for each contact. We will allow each contact to contain several phone numbers. As an exercise, create the application's PhoneNumber class. The class should be similar to Contact in that it meets the following requirements:

PhoneNumber should contain the following two properties:
Property Name Type Parameters
Type %String VALUELIST=,Business,Home,Mobile,Fax
Number %String
After creating the class definition, click Build–>Compile to compile the class.
From the relational perspective, PhoneNumber like Contact has its own table. This is because it extends %Persistent. By contrast, Address does not have its own table. Its instances are stored in extra columns of the Contact table. This is because Address extends %SerialObject rather than %Persistent.