Application Overview: Data Model
The data model for the example application consists of a pair of Caché classes: Contact and PhoneNumber. The two classes form a parent-child relationship. This means that each Contact object can contain a set of PhoneNumber objects. Each PhoneNumber object must be contained in exactly one Contact object.
Contact contains the following four properties and a class query:
-
ID — The object ID. Caché assigns values automatically. Values cannot be changed.
-
Name — Represents a contact's name. The value can be any string.
-
ContactType — Represents a contact's type. Values are restricted to “Business” and “Personal”.
-
PhoneNumbers — Represents the collection of associated phone numbers.
-
ByName — A class query that returns the ID and Name properties for all Contact instances with Name values matching the input parameter.
PhoneNumber contains the following four properties:
-
ID — The object ID. Caché assigns values automatically. Values cannot be changed.
-
PhoneNumberType — Represents the type of a phone number. Values are restricted to “Business”, “Home”, “Mobile”, and “Fax”.
-
Number— Represents the actual number. The value can be any string.
-
Contact — Represents the parent Contact object.