C++ Reference Material
Types, Data Types, Abstract Data Types (ADTs),
Data Structures and Application Programming Interfaces (APIs)
Not everyone will necessarily agree with each of the following definitions, but taken together they should give you a good sense of what we mean when we use one or more of these terms in context.
From an operational point of view, an Abstract Data Type (abbreviated ADT) is a collection of data components, together with a collection of operations that are permitted on those data components.
This is a conceptual notion, independent of any programming language, but if you are familiar with a programming language like C++ or Java, you will immediately recognize that in those languages the class is the mechanism that is used to implement this notion of an ADT.
It is very important, however, to separate the concept of a particular ADT from its implementation, and to realize that the same (conceptual) ADT may in fact be implemented in many different ways, either in different programming languages, or even in the same language.
The beauty of the ADT notion is that, since it is a notion, it can be pretty much what we want it to be. It turns out that a number of common concepts (stacks, queues, lists, and so on) are so useful that these have been given standard, tested and debugged implementations and have been placed in libraries (the Standard Template Library in C++ or the Java Foundation Classes in Java, for example). This saves us from re-inventing the wheel every time we need a stack, or a queue, or a list, or some other "container" that is available from such a library.
On the other hand, quite often there are data types that we need, or would find useful, that we just can't find in a library, and then we have to go back to the drawing board. For example, perhaps we want an ADT to provide us with a menu facility for our text-based programs and another one to provide us with an easy way to display on-line help or other items of text when our programs are running. That is, we may want to implement a Menu ADT and TextItems ADT.
As with any ADT, we then need to decide what the data components will be and how they will be represented, as well as what the operations will be and how they will be implemented. In C++, both the interface and the underlying data representation are "visible" in the C++ class specification file (the .h file), even though the data components are generally inaccessible to the "client", since they are normally either private or protected. On the other hand, the implementation of the operations (the implementation of the "interface" to the ADT, i.e., to the class) is contained in an implementation file, and the actual implementation of any operation is both invisible and inaccessible, if the class (the ADT) is made accessible via a file pair that consists of a specification file (a file with a .h extension) and a corresponding object file (one with a .obj or .o or similar extension, depending on your system).
Sometimes the domain (i.e., the data) of an abstract data type may be simple (or atomic) and other times it will be structured, which in turn leads to the ADT itself being called simple or structured.
Each operation of an ADT is implemented as a function and invoked by a function call. Sometimes "operator functions" may permit the use of "built-in" operators to be used to perform operations for a programmer-defined ADT which are analogous to their built-in counterparts.
Once an Abstract Data Type (ADT), with its private and/or protected data and its public interface are all in place, that public interface can be "published", i.e., made available to "client programmers", at which point the public interface will likely be referred to as an API, an Application Programming Interface. It contains (or should contain) all that a client programmer needs to know about how the corresponding ADT can be used in a program.
The operations found in the interface of an ADT may be classified in various ways. The following are typical (but non-orthogonal, i.e., non-mutually exclusive) categories into which any given operation may be placed: