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

Object Structure

  1. The object-oriented paradigm is based on encapsulating code and data into a single unit. Conceptually, all interactions between an object and the rest of the system are via messages. Thus, the interface between an object and the rest of the system is defined by a set of allowed messages.
  2. In general, an object has associated with it:
  3. Motivation of using messages and methods.

    All employee objects respond to the annual-salary message but in different computations for managers, tellers, etc. By encapsulation within the employee object itself the information about how to compute the annual salary, all employee objects present the same interface.

    Since the only external interface presented by an object is the set of messages to which it responds, it is possible to (i) modify the definition of methods and variables without affecting the rest of the system, and (ii) replace a variable with the method that computes a value, e.g., age from birth_date.

    The ability to modify the definition of an object without affecting the rest of the system is considered to be one of the major advantages of the OO programming paradigm.

  4. Methods of an object may be classified as either read-only or update. Message can also be classified as read-only or update. Derived attributes of an entity in the ER model can be expressed as read-only messages.

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