Book contents
- Frontmatter
- Contents
- Preface
- Part 1 Functions and Foundations
- Part 2 Procedures, Types, Memory Management, and Control
- Part 3 Modularity, Abstraction, and Object-Oriented Programming
- 9 Data Abstraction and Modularity
- 10 Concepts in Object-Oriented Languages
- 11 History of Objects: Simula and Smalltalk
- 12 Objects and Run-Time Efficiency: C++
- 13 Portability and Safety: Java
- Part 4 Concurrency and Logic Programming
- Appendix A Additional Program Examples
- Glossary
- Index
9 - Data Abstraction and Modularity
from Part 3 - Modularity, Abstraction, and Object-Oriented Programming
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Preface
- Part 1 Functions and Foundations
- Part 2 Procedures, Types, Memory Management, and Control
- Part 3 Modularity, Abstraction, and Object-Oriented Programming
- 9 Data Abstraction and Modularity
- 10 Concepts in Object-Oriented Languages
- 11 History of Objects: Simula and Smalltalk
- 12 Objects and Run-Time Efficiency: C++
- 13 Portability and Safety: Java
- Part 4 Concurrency and Logic Programming
- Appendix A Additional Program Examples
- Glossary
- Index
Summary
Computer programmers have long recognized the value of building software systems that consist of a number of program modules. In an effective design, each module can be designed and tested independently. Two important goals in modularity are to allow one module to be written with little knowledge of the code in another module and to allow a module to be redesigned and reimplemented without modifying other parts of the system. Modern programming languages and software development environments support modularity in different ways.
In this chapter, we look at some of the ways that programs can be divided into meaningful parts and the way that programming languages can be designed to support these divisions. Because in Chapters 10–13 we explore object-oriented languages in detail, in this chapter we are concerned with modularity mechanisms that do not involve objects. The main topics are structured programming, support for abstraction, and modules. The two examples used to describe module systems and generic programming are the standard ML module system and the C++ Standard Template Library (STL).
STRUCTURED PROGRAMMING
In an influential 1969 paper called Structured Programming, E.W. Dijkstra argued that one should develop a program by first outlining the major tasks that it should perform and then successively refining these tasks into smaller subtasks, until a level is reached at which each remaining task can be expressed easily by basic operations. This produces subproblems that are small enough to be understood and separate enough to be solved independently.
- Type
- Chapter
- Information
- Concepts in Programming Languages , pp. 235 - 276Publisher: Cambridge University PressPrint publication year: 2002