![]() |
|||||||||||||||||
1.1 Basic Concepts |
|||||||||||||||||
|
|||||||||||||||||
| Design Strategies Embodied in Object-Oriented Programming |
|
| abstraction | simplifying the description of a real-world entity to its essentials |
| separation | treating "what" an entity does and "how" it does it independently of each other |
| composition |
building complex "whole" systems by
|
| generalization |
identifying common elements among
|
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. The relationships depicted in the figure will be understood more deeply as the exploration of object-oriented programming unfolds.
Connections Among Strategies, Structures, and Goals |
|---|
![]() |
At this point most of the terms given as design strategies, object-oriented software structures, and software engineering goals are undefined. While these terms will be explained (see the Starting Points ), two observations can be made:
The study of a body of material often depends on the learning
style of the individual and is often iterative in progression.
Some people learn more efficiently by understanding the overall
concepts first, before proceeding to more concrete details. Other
people learn more efficiently by intermixing the abstract concepts
and the concrete examples. Regardless of the preference for a
breadth-first approach or a depth-first approach, there are necessarily
some ideas that must be learned before others, because the ideas
build on one another and are not independent. In either style,
a single reading is usually not sufficient. Backtracking and revisiting
earlier concepts often enriches understanding and allows the formation
of deeper insights into the material.
The overall structure of the material presented here is shown in the figure below; the design strategies are shown at the left. It is possible to read about these design strategies top-to-bottom and obtain a broad overview of object-oriented concepts and ideas, while 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 seven major milestones shown in the overall guide. Each milestone falls into one of three roles that are shown at the bottom of the figure. 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 or several classes that has already been developed. Simple, but interesting systems will be constructed in this first role. Initially, a single class will be used to explore and master basic issues of creating and manipulating objects. Several more classes are then added, allowing the construction of simple systems of interacting objects. Learning how to use existing classes to create and manipulate objects is the first step in learning about object-oriented programming. This first role is important not only because it establishes the foundation for the basic concepts of object-oriented programming, but also because this is the prefered role in developing real systems. As a user, you are able to benefit from the hard work already done by the designer and implementor of the existing classes. This opportunity to reuse existing classes is one of the major benefits of software reuse in general and object-oriented programming in particular. The second role is that of a developer creating one or more new classes. Initially, each class captures an independent abstraction. More difficult, but more powerful, is the development of collections of related classes using one of the forms of generalization. These first two roles will be extensively explored. The third role involves pattern - general organizations of classes and objects that have proven useful in solving commonly occurring design problems. This role will be explored, but only minimally. Mastery of the use of patterns requires considerable experience in building systems in one or more application domains.
The left column of the guide is repeated below. The entries in this table are the highest-level starting point for the study of object-oriented programming. Backtracking to this level and following new paths may happen often.
![]() ![]() ![]() ![]() ![]() ![]() |
Tasks
Additional C++ Topics
One topic that is an interesting language feature supported in C++ but not supported in some other object-oriented languages is operator overloading. Using operator overloading, the designer of a class may provide his or her own application-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 box.
Save this link for future reference.
|
|
||||
|
|
||||