GofPatterns GofPatterns


Design Patterns  «Prev 

Abstract Data Type

An abstract data type (ADT) defines a data structure in terms of the operations that can be performed on it rather than in terms of a specific implementation.
It separates what the data structure does from how it does it.
For instance, linked lists and growable arrays are simply two different implementations of the same linear list ADT since the operations that can be performed on each are the same.
In computer science, an abstract data type (ADT) is a mathematical model for a certain class of data structures that have similar behavior. An abstract data type is defined indirectly, only by the operations that may be performed on it and by mathematical constraints on the effects of those operations.
However, the concrete implementation
  1. linked list or
  2. growable array
affects the performance characteristics of the ultimate code.

Abstract data types are an object-like means of raising the bar on the size of programs that can be written in a purely procedural language. Past a million lines of code, even Object Oriented Design begins to break down.
New techniques are needed that allow truly huge programs to be both built and maintained. This is not to say, of course, that these techniques cannot also be used for more complicated programs such as games, word processors, and spreadsheets. In fact, they have been used for these things for many years, sometimes with great success, sometimes with spectacular failure. If you investigate the successes, you'll often notice that developers adopted object-oriented principles like data encapsulation even though the language they were coding in did not explicitly support it.
But it's my contention that procedural programming is not the best approach to take for these problems, that OOP more closely matches the way these programs are designed and used, and thus enhances programmer productivity.