Abstract Data Type¶
Core Idea¶
Specify a component by its externally observable behaviour — the contract — while suppressing how it does it, so any conforming implementation is interchangeable from the outside. Clients depend only on the contract; the contract is the role, the implementation the occupant.
How would you explain it like I'm…
The Remote Control Trick
The Vending Machine Promise
Contract, Not Contents
Broad Use¶
- Software engineering: the origin — behavioural specification of components, with interfaces, protocols, and abstract base classes as the implementing mechanisms.
- Legal and political systems: the office is specified by powers and duties while the incumbent is interchangeable; succession is substituting an occupant behind a stable contract.
- Organisational design: a job description separates the role (deliverables, decision rights) from the incumbent, so the organisation survives departures.
- Biology: an enzyme's functional role is specified by the reaction it catalyses, with multiple distinct molecules conforming to the same contract.
- Standards and protocols: a specification states what a conforming implementation must do without prescribing how, leaving implementations interchangeable.
- Mechanism design: a mechanism is specified by its function, independent of the institution that instantiates it.
Clarity¶
Forces the load-bearing question "is this requirement on the contract or the implementation?" and exposes a substitution diagnostic: swap a conforming occupant, and if a client breaks it depended on a leak.
Manages Complexity¶
Compresses interface design, contract completeness, hidden coupling, and leaky abstractions into one family — behavioural contract separated from substitutable implementation — with a small menu of moves on the boundary.
Abstract Reasoning¶
Supports reasoning about the substitutability guarantee, the leaky-abstraction failure mode, and the contract-evolution problem (deprecation, versioning, backward compatibility) shared across interfaces, statutes, and protocols.
Knowledge Transfer¶
- Software to institutions: the office-versus-officer split transfers into constitutional and corporate design, where succession rules and impeachment all rely on the role-versus-incumbent boundary.
- Biology to pharmacology: the function-versus-mechanism split transfers into drug design, where targets are specified by functional role and candidates evaluated against the functional contract.
Example¶
A stack's LIFO laws are the contract; an array or linked-list internal is the suppressed implementation, so swapping one for the other leaves every contract-only client unaffected.
Relationships to Other Abstractions¶
Current abstraction Abstract Data Type Prime
Parents (2) — outgoing typed relations
-
Abstract Data Type presupposes, typical Information Hiding Prime
Abstract Data Type typically presupposes Information Hiding, whose structure must already obtain for the child mechanism to be meaningful or operational.
-
Abstract Data Type presupposes Interface Prime
An ADT 'includes the interface but is richer' — a behavioural contract (interface signatures PLUS invariants/laws) with a conformance relation and substitutability guarantee.
Children (7) — abstractions linked here by typed relations
-
Container (type theory) Domain-specific is a kind of Abstract Data Type
It remains its own entry because its identity is fixed by the universe and type theory, shape type, dependent position family, extension formula, element type and labeling function, morphism or functor action, represented datatype and limits such as strict positivity.
-
Graph Data Type Domain-specific is a kind of Abstract Data Type
A graph data type is an abstract data type specialized to node-edge traversal, mutation, and query contracts over swappable representations.
-
Object-Oriented Operating System Domain-specific is a kind of Abstract Data Type
The minimal prospective placement is an instantiation of
prime:abstract_data_type. -
Queue (FIFO Abstract Data Type) Domain-specific is a kind of Abstract Data Type
The FIFO queue is an abstract data type specified by its operation contract rather than storage implementation.
-
Rational data type Domain-specific is a kind of Abstract Data Type
A rational data type specifies values and operations for exact rational numbers independently of a particular representation.
- Object-Oriented Programming Domain-specific presupposes, typical Abstract Data Type
**Abstract Data Type** is the broader abstraction this entry instantiates through a typical composition/presupposition relation.
- Substitutability Prime is a decomposition of Abstract Data Type
Substitutability is the consequence/dividend the ADT apparatus produces and disciplines ('Substitutability names the dividend; the ADT names the whole machine that pays it').
Hierarchy paths (3) — routes to 2 parentless roots
- Abstract Data Type → presupposes, typical Information Hiding → is a kind of, typical Abstraction
- Abstract Data Type → presupposes, typical Information Hiding → presupposes Boundary
- Abstract Data Type → presupposes Interface → is a decomposition of Boundary
Not to Be Confused With¶
- Abstract Data Type is not Substitutability because substitutability is the consequence (conforming implementations are interchangeable) whereas the ADT is the full apparatus (contract, conformance, contract-only dependence) that produces and disciplines it.
- Abstract Data Type is not Interface because an interface is the boundary signature whereas the ADT adds the behavioural invariants, conformance relation, and prohibition on depending past the contract.
- Abstract Data Type is not Information Hiding because information hiding is the principle of concealing what changes whereas the ADT is the structural pattern that operationalises it into a role-versus-occupant split.