Knowledge Builders

what is information hiding in oop

by Derrick Kirlin Published 2 years ago Updated 1 year ago
image

Information hiding is the primary criteria of system modularization and should be concerned with hiding the critical decisions of OOP designing. Information hiding isolates the end users from the requirement of intimating knowledge of the design for the usage of a module.

What is information hiding in programming?

Information hiding or data hiding in programming is about protecting data or information from any inadvertent change throughout the program. Information hiding is a powerful OOP feature. Information hiding is closely associated with encapsulation.

What is the difference between OOP and information hiding?

When referring to OOP, we use the term abstraction rather than information hiding. Abstraction relates to the way in which it is not necessary to know the underlying storage mechanism of a class, nor its implementation details, in order to make use of a class.

What is the difference between encapsulation and information hiding?

Information hiding is closely associated with encapsulation. Information or data hiding is a programming concept which protects the data from direct modification by other parts of the program. The feature of information hiding is applied using Class in most of the programming languages. S.marks=50; // Wrong code!

What is information hiding in system modularization?

Information hiding is the primary criteria of system modularization and should be concerned with hiding the critical decisions of OOP designing. Information hiding isolates the end users from the requirement of intimating knowledge of the design for the usage of a module.

image

Why is information hiding used?

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.

Who first described information hiding?

The concept of information hiding was first described by David Parnas in Parnas (1972). 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.

How does information hiding reduce software development risk?

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 the interface, so, if the implementation changes, the clients do not have to change.

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.

Encapsulation

In his 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."

History

The concept of information hiding was first described by David Parnas in Parnas (1972).

Example

Information hiding serves as an effective criterion for dividing any piece of equipment, software, or hardware, into modules of functionality. For instance, a car is a complex piece of equipment.

image

1.What is Information hiding in object oriented …

Url:https://freebloggingcourses.blogspot.com/2015/09/what-is-information-hiding-in-object.html

7 hours ago Information hiding is the primary criteria of system modularization and should be concerned with hiding the critical decisions of OOP designing. Information hiding isolates the end users from the requirement of intimating knowledge of the design for the usage of a module. What is …

2.Information hiding - Wikipedia

Url:https://en.wikipedia.org/wiki/Information_hiding

12 hours ago Data hiding is a software development technique specifically used in object-oriented programming (OOP) to hide internal object details (data members). Data hiding ensures …

3.Information hiding - CodeDocs

Url:https://codedocs.org/what-is/information-hiding

29 hours ago  · Information Hiding, Information hiding is the technique in which we try to hide the attributes of the object from outside world. According to this technique information in …

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9