File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes About Abstraction in OOP Concept Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "About Abstraction in OOP Concept" Watch "About Abstraction in OOP Concept" New topic

About Abstraction in OOP Concept

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

The defination for Abstraction is

Abstratction means hiding the internal details of the Object .

For the above can i take this as an example ??

Assume we are having a method called as Insert in the Data Access Layer .

The user simply calls insert .

Thank you .

Save India From Corruption - Anna Hazare.
David Newton

Joined: Sep 29, 2008
Posts: 12617

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thank you very much for clarifying .
Hiram Nascimento

Joined: Jul 09, 2009
Posts: 13

In fact abstraction means more the than just hiding implementation (it's more to do with Encapsuling).

Abstraction, in OOP concept, means choosing only aspects and behaviors that matters for your problem domain and, so, through the abstraction, you will be able to offer a simple interface (not necessarily a Java Interface) for the user to access/manipulate the class'es instances. Having a simple interface has much to do with encapsuling.

Imagine a cell phone:
You have the numeric keyboard, which is a simple interface for the internal eletronic circuits (that means an abstract way to send eletronic pulses to the CPU). Through the Abstraction you could encapsulate/hide the complicated implementation of how the keyboard generates the pulses. The cell phone user doesn't care how the Keyboard generates the pulses to send to the CPU (unless you are an electrical engineer ).

Now try to imagine a Television and answer: How would you model a TV on OOP? (This is part of the abstraction process)

It will depend on what's your problem domain: Will you use a TV object on a Shopping Cart or on a Electronics Factory?

Does it make sense?

Indeed it's not the easier concept to understand.

sindhu somisetty

Joined: Nov 17, 2009
Posts: 2
Thanku Hiram for tat info ,

Abstarction is nothing but showing outside view of object rather than its implementation.

The best example is ,

Consider a Display class for an application(say) which displays output .
Here 3 cases arises for display ,the display of application may be GUI or on command line text display or may the data that is retrived from database.

There are 3 different types of display cases for the same problem.
Therefore in order to handle this ,we can create one abstract class as Display and extend this abstract class functionality to 3 diff cases say TextDisplay class ,Gui class,DataStorage class .What so ever case we want we can call that type of class method(overriden) at runtime without affecting to other part of code .

This is main significance of abstraction.
I agree. Here's the link:
subject: About Abstraction in OOP Concept
It's not a secret anymore!