next up previous
Next: Inheritance Up: The Object-Oriented Data Model Previous: Object Structure

Object Classes

  1. Usually, there are many similar objects in a DB. By ``similar'', it means that they respond to the same messages, use the same methods, and have variables of the same name and type. We group similar objects to form a class. Each such object is called an instance of its class. E.g., in a bank DB, customers, accounts and loans are classes.
  2. The definition of the class employee, written in pseudo-code. The definition shows the variables and the messages to which the objects of the class respond, but not the methods that handle the messages.

     
    		 class employee {
    

    /* Variables */

    string name;

    string address;

    date start-date;

    int salary;

    /* Messages */

    int annual-salary();

    string get-name();

    string get-address();

    int set-address(string new-address);

    int employment-length();

    };

  3. Class: (i) captures the instance-of relationship, (ii) the basis on which a query may be formulated, (iii) enhance the integrity of OO systems by introducing type checking, and (iv) reducing replications of names and integrity-related specifications among objects in the same class.
  4. The concept of classes is similar to the concept of abstract data types. There are several additional aspects to the class concept beyond those of ADTs. To represent these properties, we treat each class as itself being an object.

    Metaclass: the class of a class. Most OODB systems do not support the strict notion of metaclass. In ORION, CLASS is the root of the class hierarchy (the metaclass of all other classes). A class object includes



Osmar Zaiane
Mon Jun 29 17:30:13 PDT 1998