Many of the programs in this book so far have focused on developing a single program for a single application. In this chapter we consider the question of building reusable software components, or software building blocks that can be used by many programs. These fall into several categories; the one we take up here is called abstract data types.
An abstract data type (ADT) is a package whose specification provides a type
and a set of operations on that type. In this chapter you will see how package
Ada.Calendar
should be viewed as an ADT, and you will use a number
of its operations for the first time.
Also in this chapter you will learn to write ADTs, and you will see the details of three useful reusable components: calendar dates, currency or monetary quantities, and employee records. Finally, we return to the spider, presenting an ADT to support mupltiple spiders in one room.
Copyright © 1996 by Addison-Wesley Publishing Company, Inc.