Skip to content

Information Hiding

Estimated time to read: 1 minute

Overview

Information hiding allows modules of our system to give others the minimum amount of information needed to use them correctly and "hide" everything else.

A module should only have access to the information that it needs to do its job, no more, no less.

Information hiding allows a developer to work on a module separately with other developers needing to know the implementation details of this module. They can only use this module through its interface.

In general things that might change, like implementation details, should be hidden. And things that should not change, like assumptions, are revealed through interfaces.

Information Hiding through Encapsulation

Encapsulation is used to bundle attributes and behaviours / methods into their appropriate class, and expose an interface to provide access.

More Information

For more information, see 209 - Class Diagrams and UML and 205 - Encapsulation (x-ers)