[Ada Information Clearinghouse]
Ada '83 Rationale, Sec 9.1: Motivation

"Rationale for the Design of the
Ada® Programming Language"

[Ada '83 Rationale, HTML Version]

Copyright ©1986 owned by the United States Government. All rights reserved.
Direct inquiries to the Ada Information Clearinghouse at adainfo@sw-eng.falls-church.va.us.

CHAPTER 9: Packages

9.1 Motivation

Packages allow the programmer to define groups of logically related items. They cover a wide variety of uses, ranging from collections of common declarations to groups of subprograms and encapsulated data types.

The ability to package declared entities - such as variables, types, subprograms, and even other packages - provides the basis for a powerful structuring tool for complex programs. Moreover, a package permits clear separation between information that is usable by the rest of the program, and other information that must remain purely internal to the package. The internal information is hidden, and thereby protected from deliberate or inadvertent use by other programmers. This serves not only to localize the effect of internal errors to the package itself, but also to make it easier to replace one implementation of (the services offered by) a package by another. Packages are thus an essential tool for program modularity, supporting program verification and information hiding as advocated by Parnas [Pa 71].

Facilities for modularization have appeared in many languages. Some of them - such as Simula, Clu, and Alphard - provide dynamic facilities which may entail large run-time overhead. The facility provided in Ada is more static - in the spirit of previous solutions offered in Lis, Euclid, Mesa, and Modula. At the same time it retains the best aspects of solutions in earlier languages such as Fortran and Jovial.

We shall first discuss packages informally by means of examples, and then go on to discuss a number of important technical issues addressed during the design of Ada.

Address any questions or comments to adainfo@sw-eng.falls-church.va.us.