Contrary to popular belief, Presentation Manager provides far more than merely the ability to achieve a windowed, graphical user interface for the display of information on the screen. Rather, Presentation Manager provides a message-driven, object-based execution environment that facilitates the provision of an event-driven, object-action user interface, and supports the implementation of object-oriented design techniques.
Presentation Manager enables the implementation of an object-action user interface by providing an application programming interface that conforms to the guidelines laid down in the IBM Systems Application Architecture Common Programming Interface Presentation Reference, and a set of underlying system services that support an object-oriented, event-driven application model. The Presentation Manager programming interface provides user interface constructs which conform to CUA guidelines. However, it must be strongly emphasized that the term "presentation interface" is a misnomer, since Presentation Manager is concerned with far more than merely the display of information on the screen.
The Presentation Manager application model is centered around the concept of windows. While a window typically appears as a rectangular area on the screen, it is in fact a "handle" to a data object; a window concerned with data being displayed on the screen is termed a display window, whereas a window concerned with an internal data object is known as an object window. Each window belongs to a window class and is associated with a window procedure, which contains the definition of the window's data object(s) and also contains methods to perform all of the processing associated with that window. Windows and their associated window procedures communicate with the user and with each other, by the use of messages that are routed to the appropriate window by Presentation Manager.
Since a window procedure may contain all the processing related to a particular data object, along with the definition of and establishment of access to that data object, Presentation Manager provides a suitable environment for data encapsulation and abstraction, in that the internal representation and workings of a data object may be "hidden" within the window procedure that "owns" the data object. Provided the external interfaces (that is, the message formats) of the window procedure remain unchanged, other window procedures within an application are insulated from changes to the data object or its processing. This provides a powerful tool for the enhancement of application modularity and the containment of change within an application. This in turn facilitates the task of application maintenance and change management, since affected application modules may be easily identified.
A close corellation may be drawn between the concept of an application object and that of a window under Presentation Manager. The window becomes the identity of, or "handle" to an object; the data referenced by the window (whether a display space on the screen or a data file) becomes a data object; the window procedure associated with a window contains the methods to act upon that data object; and actions to be performed by the application object on its data object are conveyed by way of messages routed to the window by Presentation Manager. Although Presentation Manager provides window classes to allow grouping of objects with similar characteristics, a full inheritance hierarchy is not supported, and thus Presentation Manager conforms more closely to the module-based theory of object-oriented design than to the class-based approach. Development tools such as Smalltalk V/PM** are available to extend the Presentation Manager application model and facilitate implementation of a full inheritance hierarchy.
The Presentation Manager application model, along with the underlying OS/2 environment, affords the ability to store an application object (that is, a data object definition, along with the methods associated with that data object, contained within a window procedure) in a library that may be dynamically linked with an application. This in turn provides the potential to develop and implement applications composed of one or more generic objects linked by a custom-built application harness, which allows applications to be assembled more quickly and at less cost.
The Presentation Manager programming interface includes a mechanism for subclassing a window, whereby messages destined for a particular window may be transparently diverted to another window for specialized processing. Implementing an application using generic objects with subclassing to provide specialized methods may greatly reduce the amount of coding required, and consequently reduce the development time and cost of applications.
The general implementation of and support for object-oriented programming principles under Presentation Manager is discussed further in The Presentation Manager Application Model. The subject is examined in more detail, and specific examples are discussed, in Building a Presentation Manager Application.