Abstraction is a process of hiding
complex implementation details of a system and showing only the required
functions of the system to the end users.
For any
end user only thing that matters the most is, What a system does? And
not, How it does it?
I would like to explain
Abstraction by using two simple examples, one is general example and other is
more relevant to the software.
For more general example consider a car, for outer look you find car as a
single object with the help of which you can travel easily. When you go a
little closer you will find many objects integrated in it, like steering wheel,
gear lever, brakes, accelerator, clutch, audio system, AC controller, etc.
Further each of these components is more specialized into sub components. Again
deeper when you open its hood you will find engine, transmission type of
engine, many mechanical and electrical components, etc etc… But as driver if
you think, do you need to know all these complex implementations to drive a
car? No right. You just need to know how to handle a steering wheel, brake,
gear, accelerator and clutch. These five components act as interface to the
internal operations of the car. So only an abstract view of car is seen when
you are driving it. This view is sufficient from a driver’s point of
view.
Since we are dealing with Java, it is necessary to provide you with more
relevant example of abstraction in Java’s development environment. So lets’
start! Remember the signup form which you have to fill while creating a new
gmail or yahoo account. As a user What you do? You just fill the form with the
required information and press the submit button right? No user will worry
about the process that takes place after pressing the submit button. Because it
not necessary for him. His work is done just by pressing the submit button.
Here signup form hides all the implementation details of the web application
from the end users. An abstract view of whole web application is created using
signup form. The below image can be referred for the above explanation, it
shows you how a web application is divided into layers to reduce the complexity
when it reaches the user.
Can
you think of more examples of abstractions around you? You will surely find
hundreds of them around you. Even the computer system or the mobile which you
are using now to read this blog provides you with many abstracted view of
several complex software implementations within it. Think about it!!
I guess I have helped you with
Abstraction. You can follow me on twitter and also subscribe to this blog for
free to get regular updates. Good day :)