Inheritance Hierarchy

Each object class is descended from another class, known as its parent class. Since the system object model supports the object-oriented concept of inheritance, a class may inherit data and methods from its parent class, which in turn may inherit data and methods from its parent, and so on. A class which inherits properties from other classes is therefore known as a descendant of those classes, and the classes from which it inherits are known as ancestors. The implementation of inheritance in the Workplace Shell means that when creating a new object class, a programmer simply subclasses the parent class, and need only define those characteristics that are not defined by, or are different from those of the parent class. This greatly simplifies the process of creating a new object class.

Under the system object model, every object class is a descendant of the base class SOMObject. This class defines the basic characteristics and behaviors common to all objects in the system. Other object classes are subclasses of this class. The system object model provides two additional classes, SOMClass and SOMClassManager, to form the basis of an inheritance hierarchy. The Workplace Shell extends this hierarchy by creating a number of classes of its own, based upon the SOMObject class. These Workplace Shell object classes define the characteristics of the object types that are defined and implemented by the Workplace Shell itself.

The inheritance hierarchy implemented by the Workplace Shell is illustrated in Figure "Workplace Shell Inheritance Hierarchy".

As well as being descended from the system object model base inheritance hierarchy, all Workplace Shell object classes are descended from one of three base storage classes defined by the Workplace Shell. These classes are so named because they directly influence the storage of control information and instance data for the class. The three predefined base storage classes are:

  • WPAbstract, which is the base class for abstract objects such as programs, devices, etc., and for which control information is stored in the system initialization file OS2.INI

  • WPFileSystem, which is the base class for objects that are stored as files in the file system, and for which control information is stored in the file system as extended attributes

  • WPTransient, which is the base class for objects that only exist during execution of a particular program; that is, the object is created and used for a particular purpose during processing, and then immediately deleted from the system.

    An application developer may extend the Workplace Shell inheritance hierarchy by introducing new object classes based upon those already implemented by the Workplace Shell itself. Indeed, the developer may even introduce new base classes, although this is definitely a non-trivial exercise and should be approached with caution.


    [Back: Objects in the Workplace Shell]
    [Next: Metaclasses]