Abstract Data Types
The terms Abstract and Abstraction defined:
-
From the Dictionary
Abstract -- a concept, thought, or idea apart from any particular instances or
material objects.
Abstraction -- formation of an idea, such as the qualities or properties of a
thing, separate from any particular instances of a thing or material objects.
-
In Computer Science
Abstract -- an organization of data, a manipulation of data, an algorithm etc.
apart from any particular programming language implementation of that thing.
Abstraction -- A model of a complex system that includes only the details
essential to the perspective of the viewer of the system.
-
Abstract Data Type -- A data type whose properties (domain and operations) are
specified independently of any particular implementation. Examples covered in class:
List, Stack, Queue, Tree, Graph, and Set.
Other important definitions:
-
Data Abstraction -- The separation of a data type's logical properties from its implementation.
-
Data Encapsulation -– (Another term for Data Abstraction) The separation of the representation of data from
the applications that use the data at a logical level; a programming language feature that enforces information hiding.
-
Information Hiding -– The practice of hiding the details of a function or data structure with the goal of
controlling access to the details of a module or structure.
-
Domain -- the set or range of data that an abstract data type acts on. Example: the domain of the int
data type is all whole numbers. In a computer it is the range of whole numbers that can be represented by the
operating system's implementation of the int data type.
-
Operations -- All the functions that act on the data. Example: for the int data type these operations
include +, -, *, /, %, &, |, etc.
Categories of Operations
-
Constructors - Functions that create an abstract data type. Example: int x; or new node();
Also the constructor function in a C++ class.
-
Transformers (mutators) - Functions that change the data in some way. Example: x = 3;
The equals function sets the value store in the variable x. This may include setting values,
inserting or deleting an item from an object, combining two objects (binary transformer --
example x = 2 + 3; plus (+) is the binary transformer insert() or delete() in an ADT change
the data stored.
-
Observers - Functions that allow us to observe the state of one or more of the data values
-
Predicates -- asks if a certain property is true, example: isEmpty();
-
Accessor or selector -- returns a copy of a data object, example: getX();
-
Summary -- return information about the object as a whole, example: getListLength();
-
Iterators - Functions that perform some sequential action on all data components in an object. Example: setAll(value);