Skip to main content

The Contact Management Application

The examples and exercises in this tutorial involve connecting Java code to a sample Caché application. This Contact Management application allows users to maintain a list of contacts and associated phone numbers. From an object-oriented perspective, it consists of two Caché classes: Contact and PhoneNumber. The following diagram displays their properties and operations. The relationship between the classes is described later in the tutorial.

generated description: contactandphonenumber

Contact contains the following:

  • id: The Caché object ID. Each instance will have a unique value. The Studio development environment does not display this property in the class definition.

  • ContactType: Represents the type of the contact. Possible values include only “Business” and “Personal”.

  • Name: Represents a contact's name. Possible values include any string.

  • RetrieveByContactType: Pre-defined query. Accepts a ContactType value as an argument. Returns the Name values of all matching Contact instances.

  • ListOfContacts: Class method. Retrieves the id values for all Contact instances.

PhoneNumber contains the following:

  • id: The Caché object ID. Each instance will have a unique value. The Studio development environment does not display this property in the class definition.

  • PhoneNumberType: Represents the type of the phone number. Possible values include only: “Business”, “Home”, “Mobile”, and “Fax”.

  • Number: Represents the phone number. Possible values include any string.

  • RetrieveByContactName: Pre-defined query. Accepts a Contact Name value as an argument. Returns the id values of all PhoneNumber instances contained in the Contact.

Note:

Click here for instructions for installing the Contact Management application, as well as descriptions of the Java files available for completing the exercises and running the examples.

FeedbackOpens in a new tab