|
|
|
|
|
|
|
Figure 16-1
Program Resulting from Structured
(Procedural) Programming |
|
|
|
|
|
|
|
|
A methodology that often works better for creating large software systems is object-oriented design (OD), which we introduced briefly in Chapter 4. OOD decomposes a problem into objectsself-contained entities composed of data and operations on the data. The process of implementing an objectoriented design is called object-oriented programming (OOP). The end result is a program that is a collection of interacting objects (see Figure 16-2). In OOD and OOP, data plays a leading role; the primary contribution of algorithms is to implement the operations on objects. In this chapter, we'll see why OOD tends to result in programs that are more flexible and conducive to code reuse than programs produced by structured design. |
|
|
|
|
|
|
|
|
Several programming languages have been created specifically to support OOD and OOP: C++, Smalltalk, Simula, CLOS, Objective-C, Eiffel, Actor, Object-Pascal, recent versions of Turbo Pascal, and others. These languages, called object-oriented programming languages, have facilities for |
|
|
|
|
|
|
|
|
You have already seen that C++ supports data abstraction through the class mechanism. Some non-OOP languages also have facilities for data abstraction. But only OOP languages support the other two conceptsinheritance and dynamic binding. Before we define these two concepts, we discuss some of the fundamental ideas and terminology of object-oriented programming. |
|
|
|
|
|