Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRIS, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions page (login required).

Previous sectionNext section

Exercise: Creating the PhoneNumber Class

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.