The Object-Relational Model

The Object-Relational Model

The relational model and the object-oriented model typified by ODL are two important points in a spectrum of options that could underlie a DBMS. For an extended period, the relational model was dominant in the commercial DBMS world. Object-oriented DBMS's made limited inroads during the 1990's, but have since died off. Instead of a migration from relational to object-oriented systems, as was broadly predicted around 1990, the vendors of relational systems have moved to incorporate many of the ideas found in ODL or other object-oriented-database proposals. Thus, many DBMS products that used to be called "relational" are now called "object-relational".

In "Object-Orientation in Query Languages" we shall meet the new SQL standard for object-relational databases. In this section, we cover the topic more abstractly. We introduce the concept of object-relations in this article, then discuss one of its earliest embodiments in "Nested Relations". ODL-like references for object-relations are discussed in "References", and in "Object-Oriented Versus Object-Relational" we compare the object-relational model against the pure object-oriented approach.

From Relations to Object-Relations

While the relation remains the basic concept, the relational model has been extended to the object-relational model by inclusion of features such as:

1. Structured types for attributes. Instead of allowing only atomic types for attributes, object-relational systems support a type system like ODL's:  types built from atomic types and type constructors for structs. sets and bags, for example. Particularly important is a type that is a set of structs, which is basically a relation. That is, a value of one component of a tuple can be an entire relation.

2. Methods. Special operations can be defined for, and applied to, values of a user-defined type. While we haven't yet addressed the question of how values or tuples are manipulated in the relational or object-oriented models, we shall find few surprises when we take up the subject beginning in "Relational Algebra". For instance, values of numeric type are operated on by arithmetic operators such as addition or less-than. However, in the object-relational model, we have the option to define specialized operations for a type, such as those discussed in "Methods in ODL" Example, on ODL methods for the Movie class.

3. Identifiers for tuples. In object-relational systems, tuples play the role of objects. It therefore becomes useful in some situations for each tuple to have a unique ID that distinguishes it from other tuples, even from tuples that have the same values in all components. This ID, like the object-identifier assumed in ODL, is usually invisible to the user, though there are even some circumstances where users can see the identifier for a tuple in an object-relational system.

4. References. While the pure relational model has no notion of references or pointers to tuples, object-relational systems can use these references in various ways.

In the next sections, we shall elaborate and illustrate each of these additional capabilities of object-relational systems.