Abstract Data Types

Abstract data types provide another example of interchangeable parts. The whole idea of an abstract data type is that clients can use any implementation that satisfies the specification of the abstract data type, and implementors can deliver anything that satisfies that specification.

Representation Independence

In particular, clients don't need to know how values of an abstract data type are represented, and clients don't need to know how operations of the ADT are programmed. With abstract data types, client code does not depend upon representations or algorithms. Clients care only about the behaviors described by the ADT's specification.

Information Hiding

Most clients are better off not knowing how the values of ADTs are represented, or the algorithms that implement operations of those ADTs. If clients knew that information, they might be tempted to break the abstraction barrier by relying on that information.

Interchangeability of Parts

That means all implementations of an ADT are interchangeable. Different implementations may have radically different performance profiles, and may differ in other qualities such as simplicity, robustness, or information hiding, but they all satisfy the same specification. If they didn't, they wouldn't count as implementations of that specification.

For debugging: Click here to validate.