Alternative object models

Instructor's Guide


intro, paradigms, comparison, design, prototypes, architectures, summary, Q/A, literature
Since the introduction of Smalltalk, the predominant notion of objects has been based on the distinction between classes and objects. Classes serve to describe the functionality and behavior of objects, while objects are instance of classes. In other words, classes serve as templates to create objects. Inheritance, then, may be regarded as a means by which to share (descriptions of) object behavior. It is generally defined on classes in terms of a derivation mechanism, that allows one to declare a class to be a subclass of another (super) class. The distinction between classes and objects leads to a number of difficulties, both of a pragmatic and theoretical nature. (See also sections dimensions and meta for a discussion of the theoretical problems.) For example, the existence of one-of-a-kind classes, that is classes which have only one instance, is often considered unnatural. An example of a class-less language is the language Self. Self has a Smalltalk-like syntax, but in contrast to Smalltalk only supports objects (containing slots) and messages, and hence no classes. Slots may be designated to be parent-slots which means that messages that cannot be handled by the object itself are delegated to the parent object. In contrast to inheritance, which is static since the inherited functionality is computed at object creation time, delegation to parent objects as in Self is dynamic, since parent slots may be changed during the lifetime of an object. Objects in Self may themselves be used to create other objects (as copies of the original object) in a similar way as classes may be used to create instances. However, the changes made to an object are propagated when cloning object copies. Single objects, from which copies are taken, may in other words be regarded as prototypes, approximating in a dynamic way the functionality of their offspring, whereas classes provide a more static, so to speak universal, description of their object instances. Self employs runtime compilation, which is claimed to result in an efficiency comparable to C in  [US87]. In section prototypes we will discuss the use of prototypes and the distinction between inheritance and delegation.

Alternative object models may also be encountered in object-oriented database managements systems and in systems embedding objects such as hypertext or hypermedia systems.