The benefits of using ADTs include:
There are two parts to each ADT:
In general, there are many possible operations that could be defined
for each ADT;
however, they often fall into these categories:
Good Programs Use Abstraction
What makes a program good?
One way to help achieve (2) (which helps with (1)) is to use
abstract data types, or ADTs.
The idea of an ADT is to separate the notions of specification
(what kind of thing we're working with, and what operations can
be performed on it) and implementation (how the thing and
its operations are actually implemented).
Fortunately for us,
object-oriented programming languages (like Java) make it easy for
programmers to use ADTs:
Each ADT corresponds to a class, and the operations on the
ADT are the class's public methods
The user, or client of the ADT only needs to know about the method
interfaces (the names of the methods, the types of the
parameters, what the methods do, and what if any values they return),
not the actual implementation.
Abstract Data Types
In this class, we will study a number of different abstract data types,
different ways to implement them, and different ways to use them.
Our first ADT (coming up in the next set of notes) is the List.