1.1 Basic Concepts



Object-Oriented Strategies


Object-oriented programming embodies a number of powerful design strategies in software structures that are based on practical and proven software engineering techniques. The design strategies evolved as techniques for dealing with complex natural and man-made system. By incorporating support for these strategies in software structures, object-oriented programming makes possible the manageable construction of more complex systems of software than was previously possible. The nature of these software structures has been shaped by decades of software engineering experience.

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

abstraction simplifying to its essentials the
description of a real-world entity
separation treating independently "what" an
entity does from "how" it does it
composition building complex "whole" systems by
assembling simpler "parts" in one of
two basic ways:

  • association
  • aggregation

generalization identifying common elements among
different entities in one of four ways:

  • hierarchy
  • genericity
  • polymorphism
  • patterns

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.


A Plan of Study


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 each other and are not independent. In both styles, 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 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.


Getting Started


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 be common.

Lets get to it!


Starting Points


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.


Additional C++ Topics


Exercises

  1. Search the world-wide web to find references to different object-oriented languages? How many can you find? Can you recognize in their descriptions any of the basic strategies identified above?

  2. Search the world-wide web to find locations of other courses on object-oriented programming. What topics do these courses have in common? Save these links for reference during your study.

  3. Look at the Free On-Line Dictionary of Computing . Find the definitions of the terms:

    Save this link for future reference.

  4. Look at the C++ Virtual Library. Browse this library for ten minutes. Keep this link for reference.

Last Updated: June 23, 1996 / kafura@cs.vt.edu