Difference between Data Hiding and Data Abstraction

Key difference: Data hiding, also known as information hiding or data encapsulation in computer science, is a software development technique used in object-oriented programming (OOP). It is mainly used to hide internal object details, i.e. the design decisions in a computer program that are most likely to change. Abstraction is another process in computer science. It hides away implementation details from data and programs. It only shows relevant details as and when required by the program.

Data hiding, also known as information hiding or data encapsulation in computer science, is a software development technique used in object-oriented programming (OOP). It is mainly used to hide internal object details, i.e. the design decisions in a computer program that are most likely to change. This hides the data from other parts programs, so that when the data or design decisions do change, they will not have an impact on the whole program, just the parts that the details are not hidden from. This in turn makes the overall program much more stables, as a single change in a part of the program in not likely to change the whole program.

Data hiding also has the ability to prevent certain aspects of a class or software component from being accessible to its clients. This is achieved by using either programming language features like private variables or an explicit exporting policy. Data hiding also reduces system complexity for increased robustness by limiting interdependencies between software components.

 Abstraction is another process in computer science. It hides away implementation details from data and programs. It only shows relevant details as and when required by the program.

Data abstraction allows the programmer to reduce and factor out details so that he can focus on a few concepts at a time. It shows only the details that are required by the user, whereas all the other details and information is hidden. This streamlines that data that is available, so that the user may not have to deal with details that are unnecessary at the time.

A system can have several abstraction layers. Each layer would have different meanings and hide different details. Wikipedia lists this example: low-level abstraction layers expose details of the computer hardware where the program is run, while high-level layers deal with the business logic of the program.

The main difference between data hiding and data abstraction is that data hiding hides some data from the other parts of the program. This data is never available of the parts of the program that it is hidden from, until the programmer rewrites the code to unhide the data. In data abstraction, however, the data is not completely hidden. It is just not shown as it is not currently relevant. If the data were to become relevant, then it would be shown. 

Image Courtesy: morebooks.de, dryreading.com

Most Searched in Food and Drink Most Searched in Pregnancy and Parenting
Most Searched in Education and References Most Searched in Society and Culture
Miss vs Ms.
Teak Wood vs Rubber Wood
iPad Mini vs Nexus 7
Coffee Beans vs Cocoa Beans

Comments

nice effort

Add new comment

Plain text

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.