Caché QuickStart Tutorial
Contact Management Data Model
[Back] [Next]
   
Server:docs1
Instance:LATEST
User:UnknownUser
 
-
Search:    

Much of the tutorial focuses on building a web-based contact management application. When complete, this application will allow you to store information about your contacts, their addresses, and phone numbers. You will be able to search, edit, add, and delete contacts through a web interface.

From an object-oriented perspective, the model will consist of three classes:
The three classes will be related. Each Contact will contain a single Address as well as several PhoneNumbers.
The following diagram shows this relationship:
From a relational perspective, both Contact and PhoneNumber will be represented by separate tables. Address, however, will correspond to a set of columns within the Contact table.
Here is the relational schema:
Notice that each table has an ID column. This column represents the unique row id (object id) for each row (object). Notice also that the PhoneNumber table contains a Contact column. This column contains the ID of the parent Contact row (object).
We will develop in an object-oriented fashion. We will build the class from the object model. Caché will automatically project these class definitions to their relational representations.
Note:
Contact and PhoneNumber are Persistent classes while Address is a Serial class. For more information on persistent and serial classes as well as other types of Caché classes, read Kinds of Classes in the Defining and Compiling Classes section of Using Caché Objects.