[Ada Information Clearinghouse]

Ada '83 Quality and Style:

Guidelines for Professional Programmers

Copyright 1989, 1991,1992 Software Productivity Consortium, Inc., Herndon, Virginia.

CHAPTER 4: Program Structure

Proper structure improves program clarity. This is analogous to readability on lower levels and facilitates the use of the readability guidelines (Chapter 3). The various program structuring facilities provided by Ada were designed to enhance overall clarity of design. These guidelines show how to use these facilities for their intended purposes.

Abstraction and encapsulation are supported by the package concept and by private types. Related data and subprograms can be grouped together and seen by a higher level as a single entity. Information hiding is enforced via strong typing and by the separation of package and subprogram specifications from their bodies. Additional Ada language elements that impact program structure are exceptions and tasks.

In this chapter...

4.1 High-Level Structure
4.1.1 Separate Compilation Capabilities
4.1.2 Subprograms
4.1.3 Functions
4.1.4 Packages
4.1.5 Cohesion
4.1.6 Data Coupling
4.1.7 Tasks

4.2 Visibility
4.2.1 Minimization of Interfaces
4.2.2 Nested Packages
4.2.3 Restricting Visibility
4.2.4 Hiding Tasks

4.3 Exceptions
4.3.1 Using Exceptions to Help Define an Abstraction

high-level structure

Back to document index