Previous | Table of Contents | Next |
As noted in the earlier parts of this chapter, object-oriented programming adds several important new ideas to the concept of the abstract data type. Foremost among these is message passing. Activity is initiated by a request to a specific object, not by the invoking of a function. In large part, this is merely a change of emphasis; the conventional view places primary emphasis on the operation, whereas the object-oriented view emphasizes the value itself. (Do you call the push routine with a stack and a data value, or do you ask a stack to push a value onto itself?) If this were all there is to object-oriented programming, the technique would not be considered a major innovation. But added to message passing are powerful mechanisms for overloading names and reusing software.
Implicit in message passing is the idea that the interpretation of a message can vary with different objects. That is, the behavior and response that the message elicit will depend on the object receiving it. Thus, push can mean one thing to a stack and a very different thing to a mechanical-arm controller. Because names for operations need not be unique, simple and direct forms can be used, leading to more readable and understandable code.
Finally, object-oriented programming adds the mechanisms of inheritance and polymorphism. Inheritance allows different data types to share the same code, leading to a reduction in code size and an increase in functionality. Polymorphism allows this shared code to be tailored to fit the specific circumstances of individual data types. The emphasis on the independence of individual components permits an incremental development process in which individual software units are designed, programmed, and tested before being combined into a large system.
The history of object-oriented programming is full of ironies. Not so long ago, the 25th anniversary of OOP was celebrated, making object-oriented concepts about half the age of computer science as a whole. Although I earlier credited Alan Kay as being the father of object-oriented programming, Kay states clearly that all the basic ideas of object-oriented programming can be found in the programming language Simula 67 (Dahl & Nygaard, 1966), which was developed in the 1960s. However, had not Kay popularized object-oriented ideas with Smalltalk, Simula would probably have become little more than an interesting footnote in the discussion of programming languages. Thus, object-oriented concepts are, in computer science years (which, like dog years, run many times faster than the calendar), almost ancient history. Yet many people are just now discovering the concepts of object-oriented programming, making it one of the newest and fastest-growing ideas in the computer world today. The best programmers have always emphasized encapsulation, working in a more-or-less object-oriented fashion; yet programmers with years of experience in an imperative style of software development often have the most difficult time switching to an object-oriented way of thinking. It is this tug and pull of revolution and evolution, of new ideas being created and old ideas being seen in a new light, that makes object-oriented programming one of the most exciting areas of computer science today.
Brooks, F. P., Jr. 1975. The mythical man-month: Essays on software engineering. Reading, MA: Addison-Wesley.
Budd, T. A. 1987. A little Smalltalk. Reading, MA: Addison-Wesley.
Budd, T. A. 1997. An introduction to object-oriented programming (2nd ed.). Reading, MA: Addison-Wesley.
Dahl, O.-J., and K. Nygaard. 1966. Simula, an Algol-based simulation language. Communications of the ACM 9(9):671-678.
Goldberg, A., and D. Robson. 1983. Smalltalk-80: The language and its implementation. Reading, MA: Addison-Wesley.
Kay, A. C. 1977. Microelectronics and the personal computer. Scientific American 237(3):230-244.
Kay, A. C. 1993. The early history of Smalltalk. The Second ACM SIGPLAN history of programming languages conference (HOPL-II), ACM SIGPLAN Notices 28(3):69-75.
Parnas, D. L. 1972. On the criteria to be used in decomposing systems into modules. Communications of the ACM 15(12):1059-1062.
Stroustrup, B. 1982. Classes: An abstract data type facility for the C language. ACM Sigplan Notices, 17(1):42-51.
Previous | Table of Contents | Next |