Saturday, 16 February 2013

What Is Data Hiding?




Data hiding is a method used in object-oriented programming to hide information within computer code.

It presents several advantages for programmers, because objects are unable to connect to irrelevant data and hackers are less likely to be able to access data.

At the same time, hiding data can make it harder for a programmer , who may need to use more code to create effects in hidden data than would be necessary if the data were public.

If an object does access hidden data, it will return an error. This is because the object cannot see the data, so any functions or data that are labeled as hidden will look invisible to the object.

Data hiding ensures that, if a programmer does make this link, the program will simply return an error so the programmer can quickly correct the mistake. This also ensures that all of the objects are truly isolated units, which is the main concept of object-oriented coding.

Volatile data are typically hidden because, if such data were made public, it could damage the object and destroy the entire program.

By hiding the data, it's much harder to crack the code, because the data will appear invisible to the objects and the hacker.

1 comment: