The basic design strategies that are embodied in object-oriented programming are presented in the table below. Because these strategies are so fundamental, they are encountered in other contexts and in other programming language forms. What is stressed here is the relationship of these strategies to the design and construction of object-oriented software.
Design Strategies Embodied In Object-Oriented Programming
| ||
---|---|---|
| ||
| ||
| ||
|
These strategies are widely supported by existing object-oriented languages though different languages may present them in different ways and some languages do not support all of the variations of each one. For example, some object-oriented languages may not support all of the types of generalization.
To master object-oriented programming one must understand the connections among the design strategies, the software structures supporting the strategies, and the software engineering goals that the strategies and structures are meant to achieve. Some of the principal connections are shown in the figure below. Understanding these connections enables the construction of useful and well-designed systems that solve important problems.
Connections Among Strategies, Structures and Goals |
---|
The relationships depicted in the figure will be understood more deeply as the exploration of object-oriented programming unfolds.
The overall structure of the material presented here is shown in the figure below. The basic conceptual material is shown at the left. It is possible to read this material top-to-bottom and obtain a broad overview of object-oriented concepts and ideas. At any point it is also possible to follow one of the arrows to the right. Following an arrow in this direction leads to a more concrete presentation of the concept and its eventual description in C++.
Guide to Material |
---|
There are six major milestones shown in the overall guide. Each milestone is associated with a major design concept and represents a significant step forward in the practical skill of developing object-oriented software systems. The milestones, however, are ordered. It is not possible to proceed to a later one (one lower and more to the right in the figure) before all of the earlier ones (ones higher and to the left) have been completed.
The milestones form a progression of roles as shown along the bottom of the figure. The simplest role is that of a programmer using a single class that has already been developed. The next role is that of a programmer using several different classes that have already been developed. Simple, but interesting systems will be constructed in each of these first two roles. The third role is that of a developer creating one or more new classes, each class capturing an independent abstraction. The fourth role involves developing collections of related classes using one of the forms of generalization. The final role is that of a pattern developer, a role played only after considerable experience in building systems in an application domain has been obtained.
Lets get to it!
|
There is also one topic that is an interesting language feature supported in C++ that is not supported in some other object-oriented languages. This topic is operator overloading. Using operator overloading the designer of a class may provide class-specific meaning for most of the built-in operators ( +, -, *, /, =, ==, !=, <, >, etc.). Operator overloading is a useful means of providing an appealing, intuitive, and natural way to perform common operations on user-defined objects. Starting points for this topic are shown in the following table.
|
Exercises |
Save this link for future reference.