|
In computer science, the principle of information hiding is the hiding of design decisions in a computer program that are most likely to change, thus protecting other parts of the program from change if the design decision is changed. Protecting a design decision involves providing a stable interface which shields the remainder of the program from the implementation (the details that are most likely to change). In modern programming languages, the principle of information hiding manifests itself in a number of ways, including encapsulation (given the separation of concerns) and polymorphism. Computer science, or computing science, is the study of the theoretical foundations of information and computation and their implementation and application in computer systems. ...
An interface defines the communication boundary between separate computer components. ...
In computer science, separation of concerns (SoC) is the process of breaking a program into distinct features that overlap in functionality as little as possible. ...
In computer science, polymorphism means allowing a single definition to be used with different types of data (specifically, different classes of objects). ...
Uses
The term encapsulation is often used interchangeably with information hiding, while some make distinctions between the two [1]. It seems that people, however, fail to agree on the distinctions between information hiding and encapsulation though one can 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. The most common use of information hiding is to hide the physical storage layout for data so that if the physical storage layout 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. A floating-point number is a digital representation for a number in a certain subset of the rational numbers, and is often used to approximate an arbitrary real number on a computer. ...
In computing, a scalar is a variable or field that can hold only one value at a time; as opposed to composite variables like array, list, record, etc. ...
In computer programming, a group of homogeneous elements of a specific data type is known as an array, one of the simplest data structures. ...
In object-oriented programming, information hiding 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 the interface so if the implementation changes, the clients do not have to change. The authors of Design_Patterns discuss the tension between inheritance and encapsulation at length and state that in their experience, designers overuse inheritance (Gang of Four 1995:20). The danger is stated as follows: In computer science, object-oriented programming (OOP) is a computer programming paradigm. ...
In computer science, dependency or coupling is the degree to which each program module relies on each other module. ...
An interface defines the communication boundary between separate computer components. ...
Design Patterns: Elements of Reusable Object-Oriented Software (ISBN 0-201-63361-2) is a software engineering book proposing standard solutions and naming conventions to common problems in software design. ...
In object-oriented programming, inheritance is a way to form new classes (instances of which are called objects) using classes that have already been defined. ...
"Because inheritance exposes a subclass to details of its parent's implementation, it's often said that 'inheritance breaks encapsulation'". (Gang of Four 1995:19) In object-oriented programming, a subclass is a class that inherits some properties from its superclass. ...
Example Information hiding serves as an effective criteria for dividing any piece of equipment, software or hardware, into modules of functionality. For instance a car is a complex piece of equipment. In order to make the design, manufacturing, and maintenance of a car reasonable, the complex piece of equipment is divided into modules with particular interfaces hiding design decisions. By designing a car in this fashion, a car manufacturer can also offer various options while still having a vehicle which is economical to manufacture. A module is a self-contained component of a system, which has a well-defined interface to the other components; something is modular if it includes or uses modules which can be interchanged as units without disassembly of the module. ...
For instance, a car manufacturer may have a luxury version of the car as well as a standard version. The luxury version comes with a more powerful engine than the standard version. The engineers designing the two different car engines, one for the luxury version and one for the standard version, provide the same interface for both engines. Both engines fit into the engine bay of the car which is the same between both versions. Both engines fit the same transmission, the same engine mounts, and the same controls. The differences in the engines are that the more powerful luxury version has a larger displacement with a fuel injection system that is programmed to provide the fuel air mixture that the larger displacement engine requires. An engine is something that produces some effect from a given input. ...
Look up engineer in Wiktionary, the free dictionary. ...
Image:Gearbox. ...
Displacement, One complete cycle of a four cylinder, four stroke engine. ...
The examples and perspective in this article or section may not represent a worldwide view. ...
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. With all of these changes, most of the car is the same between the standard version and the luxury version. The radio with CD player is a module which replaces the standard radio, also a module, in the luxury model. The more comfortable seats are installed into the same seat mounts as the standard types of seats. Whether the seats are leather or plastic, lumbar support or not, doesn't matter. A compact disc player or CD player is an electronic device to play audio from compact discs. ...
The front suspension components of a Ford Model T. Suspension is the term given to the system of springs, shock absorbers and linkages that connects a vehicle to its wheels. ...
A tire or tyre (see spelling differences and etymological origins) is a device covering the circumference of a wheel. ...
The engineers design the car by dividing the task up into pieces of work which are assigned to teams. Each team then designs their component to a particular standard or interface which allows the sub-team flexibility in the design of the component while at the same time ensuring that all of the components will fit together. (See also American system of manufacturing.) A team comprises any group of people or animals linked in a common purpose. ...
Software component representations: above the representation used in UML, below the representation commonly used by Microsofts COM objects. ...
Standardization, in the context related to technologies and industries, is the process of establishing a technical standard among competing entities in a market, where this will bring benefits without hurting competition. ...
The American system of manufacturing, developed by Eli Whitney in 1799, involves semi-skilled labour using machine tools and templates (or jigs) to make standardized, identical, interchangeable parts, manufactured to a tolerance. ...
As can be seen by this example, information hiding provides flexibility. This flexibility allows a programmer to modify functionality of a computer program during normal evolution as the computer program is changed to better fit the needs of users. When a computer program is well designed decomposing the source code solution into modules using the principle of information hiding, evolutionary changes are much easier because the changes typically are local rather than global changes. Cars provide another example of this in how they interface with drivers. They present a standard interface (pedals, wheel, shifter, signals, gauges, etc.) on which people are trained and licensed. Thus, people only have to learn to drive a car; they don't need to learn a completely different way of driving every time they drive a new model. (Granted, there are manual and automatic transmissions and other such differences, but on the whole cars maintain a unified interface.) A manual transmission (also known as a stick shift, straight drive, or standard transmission) is a type of transmission used in automotive applications. ...
An automatic transmission is an automobile gearbox that can change gear ratios automatically as the car or truck moves, thus freeing the driver from having to shift gears manually. ...
History The concept of information hiding was first documented in a paper by David Parnas, "On the Criteria to Be Used in Decomposing Systems Into Modules" published in Communications of the ACM in December, 1972. David Lorge Parnas (born February 10, 1941) is an early pioneer of software engineering who developed the concept of module design which is the foundation of object oriented programming today. ...
Communications of the ACM (CACM) is the flagship monthly magazine of the Association for Computing Machinery. ...
1972 (MCMLXXII) was a leap year starting on Saturday. ...
See also |