Posted in Information Technology & Systems, Total Reads: 714
Abstraction is a process of hiding or removing the unwanted characteristics of an entity so as to reduce the complexity and thereby increase the efficiency. Through abstraction, only the essential or relevant characteristics of an object is included and the extraneous ones are eliminated. Thus only the necessary details are visible to the end user.
Abstraction separates the user of the object and its implementation. Hence the object becomes easy to comprehend. A real world example of this could be a situation when we are going to visit someone we have never seen. Here the necessary details such as the height, complexion and color of clothes worn are shared. However there are a lot of other information like ones likes/dislikes, account number, favourite food etc which are irrelevant for recognizing purpose. Although entities may any number of abstractions, these could be used for some other purpose. In programming terms, suppose we have a method which is calculating the salary of an employee by taking his employee number as an input parameter. Now for any user, it is not necessary to know how the method is calculating the salary. All he is concerned about is the employee number which he would feed in the method which in turn would return the salary as output. Therefore abstraction is basically exposing only the information which are of concern to the user. In this way, abstraction helps in reusability of the method or code because if there is any change in the process of any operation, only the inner details of the method needs to be changed.
There are three different levels of abstraction which the database users use to hide the complexity:
a) Physical Level: This is the lowest level of abstraction that describes how a system stores the data in detail.
b) Logical Level: This is the middle level of abstraction which describes what data is stored in the database and the relationship among the data.
c) View Level: This is the highest level of abstraction and is concerned with only a part of the whole database. This simplifies the interaction with the system as the users goes through only the part of the database which is relevant and not the complete data.
Using a cell phone without the need to know the internal working of it is a perfect example of abstraction.