It can be seen from the foregoing discussion that the object-oriented paradigm is a logical consequence of the move toward data-centered application design. An object-oriented approach provides many benefits for applications which manipulate data, not the least of which is the ability to implement an intuitive, event-driven user interface where the user manipulates a number of conceptual objects in a metaphorical manner that mirrors the "real-life" manipulation of those objects.
It should be stressed however, that object-oriented programming is not necessarily suited to all applications; its use is recommended only where data is the central factor in the application's task. There may be situations where the procedure, rather than the data, is necessarily the focus of the application, or where an event-driven style of user interface is not appropriate to the task being performed. In such cases, traditional structured programming techniques hold advantages over object-oriented programming. However, in situations where only a portion of the work task is procedurally oriented, it is possible for the two approaches to coexist within the same application.
Object-oriented programming focuses on the principles of data abstraction and encapsulation, with all access to a data object being controlled by the application object which "owns" that data object. This principle allows the object-oriented approach to facilitate the creation of reusable application objects, since the interface to an object is defined only by the messages it receives and dispatches. The implementation details of the data objects or methods belonging to an application object are typically transparent to other application objects. Thus the effects of changes to these data objects or methods may be contained within a single application object, easing the task of change management and application maintenance.
A distinction must also be drawn between an object-oriented application design and an event-driven, object-action user interface. The two concepts are complimentary in that the provision of a truly event-driven interface for the end user is dependent upon the application being designed and implemented according to object-oriented principles. However, while the two concepts are complimentary, they are not identical and the difference must be borne in mind when designing an application.
Object-oriented application design begins with a definition of logical data entities and their representations (data objects) in the system. Once these data objects are defined, the actions relevant to each may be determined, and the design of the messages to convey each action and the methods necessary to achieve the actions may be undertaken. The definition of messages and actions completes the high-level design of the application, and traditional functional decomposition techniques may then be applied to designing and developing the individual methods. The independent nature of application objects and of the methods within an object facilitates modularization of the application, and allows the design, development and testing of the methods for each object to take place independently of the methods for other objects.
A number of programming languages and tools exist which implement object-oriented programming practices to varying degrees. These may exist in the form of object-oriented extensions to an existing programming language, or as complete programming languages in their own right. The degree to which these products enforce object-oriented practices also varies from one product to the next. It should be stressed however, that the implementation of object-oriented techniques in application design and development is not dependent upon the use of any particular tool or programming language, but rather depends on the correct application of object-oriented design concepts. When such concepts are correctly applied in the design of an application, it is quite possible to develop object-oriented applications in conventional programming languages such as "C". The difference lies in the amount of latitude given to the individual application developer with respect to the interpretation of object-oriented principles.
It may be argued with some justification, that according to many popularly-accepted definitions, the techniques offered in this chapter do not constitute a truly object-oriented application model. However, such concepts as a full inheritance hierarchy are not directly supported by execution environments such as Presentation Manager, and are difficult to provide without the use of additional object-oriented programming tools. It must be stressed that the methodology outlined herein is not intended to be a purist implementation of the full object-oriented paradigm, but is intended to illustrate the application of certain object-oriented principles to the design and implementation of Presentation Manager applications, in accordance with the module-based approach to object-oriented programming.
These principles, when applied to the Presentation Manager environment, afford significant enhancements in the areas of code reusability and application modularity, and subsequent benefits with respect to reduced development time and effort, and easier application maintenance and change management. Additional tools may be utilized to apply further object-oriented principles to Presentation Manager application design, in order to achieve the benefits associated with a class-based approach to object-oriented programming. However, such tools typically have additional drawbacks that must be weighed against their advantages, with regard to the specific development scenario.