Information hiding

related topics
{math, number, function}
{system, computer, user}
{law, state, case}
{theory, work, human}
{work, book, publish}
{car, race, vehicle}

In computer science, information hiding is the principle of segregation of the design decisions in a computer program that are most likely to change, thus protecting other parts of the program from extensive modification if the design decision is changed. The protection involves providing a stable interface which protects the remainder of the program from the implementation (the details that are most likely to change).

Written another way, information hiding is the ability to prevent certain aspects of a class or software component from being accessible to its clients, through an explicit exporting policy and through reliance on the short form[clarification needed] as the primary vehicle for class documentation.

Contents

Overview

The term encapsulation is often used interchangeably with information hiding. Not all agree on the distinctions between the two though; one may think of information hiding as being the principle and encapsulation being the technique. A software module hides information by encapsulating the information into a module or other construct which presents an interface.[1]

A common use of information hiding is to hide the physical storage layout for data so that if it is changed, the change is restricted to a small subset of the total program. For example, if a three-dimensional point (x,y,z) is represented in a program with three floating point scalar variables and later, the representation is changed to a single array variable of size three, a module designed with information hiding in mind would protect the remainder of the program from such a change.

In object-oriented programming, information hiding (by way of nesting of types) reduces software development risk by shifting the code's dependency on an uncertain implementation (design decision) onto a well-defined interface. Clients of the interface perform operations purely through it so if the implementation changes, the clients do not have to change.

Encapsulation

In his influential book on object-oriented design, Grady Booch defined encapsulation as "the process of compartmentalizing the elements of an abstraction that constitute its structure and behavior; encapsulation serves to separate the contractual interface of an abstraction and its implementation."[2] This formulation is cited by a number of books as an authoritative definition of encapsulation.

Full article ▸

related documents
Randomizer
Document Object Model
BASIC09
Linker
Command-line interpreter
RenderMan Interface Specification
X.500
Cepstrum
Roxen (web server)
Wikipedia:Free On-line Dictionary of Computing/I - K
Thread safety
Maxima (software)
Bootstrapping
International Data Encryption Algorithm
Triple DES
Scilab
Computer algebra system
Maclisp
E.164
Extensible Stylesheet Language
Adapter pattern
Bourne shell
Visual Instruction Set
Top-level domain
Great Internet Mersenne Prime Search
Portable Distributed Objects
Amiga E
Fractal antenna
Microsoft Version Number
Curl (programming language)