Introduction

Every time we decide to represent a certain set of quantities in a particular way, we are defining a new data type: the data type whose values are those representations and whose operations are the procedures that manipulate those entities. Data abstraction divides a data type into two pieces: an interface and an implementation.

Abstract Data Type

Example: Datatype of Natural Numbers

Interface

Of course, not just any set of procedures will be acceptable as an implementation of this interface. A set of procedures will be acceptable as implementations of zero, is-zero?, successor, and predecessor. This set of procedures is the interface specification for natural numbers. This specification does not dictate how these natural numbers are to be represented. It requires only that these procedures conspire to produce the specified behavior.

Constructors

Most interfaces will contain some constructors that build elements of the data type.

Observers

Most interfaces will contain some observers that extract information from values of the data type.

Client Code