Direct Implications of the Information Hiding Principle

An important implication of the information hiding principle is that module interfaces should be separated from their implementations. In the Timor context, which embraces object-orientation based on the information hiding principle as its key structuring unit, this has several further direct implications:

  • classes should be abandoned in favour of types, which can have separate (potentially multiple) implementations;
  • objects of the same type can use different implementations, even within a single program;
  • type interfaces should not include raw data structures;

(Note: Timor provides an information-hiding conform mechanism which gives programmers the impression that they can declare simple variables in a type definition.)

  • type methods (i.e. methods which define behaviour relating to the type itself or to multiple objects of the type, e.g. to compare them) and their implementations should be separated from types and implementations for individual objects of the type.