Summary

It can be seen from the foregoing discussion that Presentation Manager provides a base that facilitates the implementation of module-based object-oriented conventions by application programs. The concepts of an application object and its methods are implemented under Presentation Manager as a window and its window procedure.

Windows are grouped into classes and a window procedure is associated with a window on the basis of its class, in a parallel to the concept of allocating methods to an object class rather than to individual instances of that class. Window classes are defined in isolation however, and the concept of an inheritance hierarchy is not imposed by Presentation Manager, thus further enhancing the potential for efficient reuse by increasing object granularity. Presentation Manager allows windows to be subclassed, in order to allow additional or modified methods to be applied to an object in response to new or specialized actions. This provides an additional enhancement to the capability of code reuse, since it is not necessary to create a new object class in order to implement small modifications to an existing class.

Windows communicate with the system and with each other by way of messages, which are queued and routed by Presentation Manager, and which are processed in a serial fashion by the target window procedure. This messaging model is a practical implementation of the message-driven communication precept of object-oriented application design.

While not supported explicitly by Presentation Manager, the object-oriented concept of encapsulation is supported implicitly by the ability of a window procedure to define and thus "own" a data object. The concept of polymorphism is also supported by Presentation Manager, since the behavior and results obtained from a window procedure are dependent upon, and only upon the class and contents of messages sent to that window procedure. In a similar fashion, the result of a message is dependent upon the window procedure (application object) to which it is passed. The isolation of data objects within an application object facilitates the containment of change by enhancing application modularity, thus easing the task of change management and application maintenance. Table "Application Object/Window Correlation"

The ability to encapsulate the definitions of data objects with the methods used to manipulate those objects, and to store the resulting application objects in object libraries, facilitates the notion of reusability, which is one of the central precepts of object-oriented programming. The dynamic linking facilities provided by OS/2 further extend the potential for reusable application objects. Reusable objects may be defined and stored for use by multiple applications; indeed, multiple objects may direct messages to a single instance of an object executing in the system. The message queueing and serialization provided by Presentation Manager ensures the correct sequence of processing to preserve the user's intention and facilitate the integrity of data objects.

It may be seen that the concept of an application object as defined in Object-Oriented Applications and the implementation of a window under Presentation Manager have a strong correlation. A window may be regarded as the identity of an application object. That object is associated with a data object and a set of methods (the window procedure) that perform actions upon the data object. Class-specific data is defined within the window procedure, while storage for instance data is defined dynamically and pointers typically stored in window words. Windows communicate with the user and with one another by way of messages. Thus the window is the implementation of an application object under Presentation Manager.

Hence Presentation Manager provides an execution environment and a basic application architecture that supports the implementation of object-oriented applications, within the boundaries of IBM Systems Application Architecture. Although it does not provide a complete development environment that enforces object-oriented guidelines, it offers the basis upon which such a development environment may be based.


[Back: Subclassing]
[Next: The Flat Memory Model]