Information hiding

Written in another way, information hiding is the ability to prevent certain aspects of a class or software component from being accessible to its clients, using either programming language features (like private variables) or an explicit exporting policy.

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.

Another benefit of encapsulation is that it reduces system complexity and thus increases robustness, by limiting the interdependencies between software components.

Similarly, if the clock were replaced by a different model, the layperson could continue to use it in the same way, provided that the interface works the same.

[3][4] Before then, modularity was discussed by Richard Gauthier and Stephen Pont in their 1970 book Designing Systems Programs although modular programming itself had been used at many commercial sites for many years previously – especially in I/O sub-systems and software libraries – without acquiring the 'information hiding' tag – but for similar reasons, as well as the more obvious code reuse reason.

[clarification needed] Information hiding serves as an effective criterion for dividing any piece of equipment, software, or hardware, into modules of functionality.

In addition to the more powerful engine, the luxury version may also offer other options such as a better radio with CD player, more comfortable seats, a better suspension system with wider tires, and different paint colors.

Motor vehicle manufacturers frequently use the same core structure for several different models, in part as a cost-control measure.

Such a "platform" also provides an example of information hiding, since the floorplan can be built without knowing whether it is to be used in a sedan or a hatchback.