Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Java in General and the fly likes what are the advantage of abstraction in OOP? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "what are the advantage of abstraction in OOP?" Watch "what are the advantage of abstraction in OOP?" New topic
Author

what are the advantage of abstraction in OOP?

sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1199
what is the advantage of abstraction in OOP?
sam liya
Ranch Hand

Joined: Nov 25, 2008
Posts: 1199
I found one.
It is reusability.
is there any other things?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30752
    
156

Readability too. If things are properly abstracted, the reader doesn't need to retain everything in his/her head at once.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Anwar Hussain
Ranch Hand

Joined: Jul 24, 2009
Posts: 35
Hi aruna , Abstraction is mainly meant for removing the code duplication and also for supporting polymophism and also code reusability.
Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

aruna sameera wrote:what is the advantage of abstraction in OOP?


Abstraction lets you focus on what the object does instead of how it does it.
see also Abstraction
Anwar Hussain
Ranch Hand

Joined: Jul 24, 2009
Posts: 35
Muhammad Ali Khojaye wrote:
aruna sameera wrote:what is the advantage of abstraction in OOP?


Abstraction lets you focus on what the object does instead of how it does it.
see also Abstraction


hey , link you sent was pointing towards my point i.e abstraction eliminates duplication of code. Have you read the link topic before sending it???
Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

Yes i know
and i am more focus on "Abstraction in object oriented programming".
Anwar Hussain
Ranch Hand

Joined: Jul 24, 2009
Posts: 35
Can you please give me one example where in abstraction is to hide the implementation details from user as you said.
Antany Vasanth
Ranch Hand

Joined: Jan 28, 2009
Posts: 43
Hello Anwar,

Hiding implementation details means not from user. It hides implementation logic from another class.

The other class doesn't need to know about the logic. It simply uses the class without knowing about implementation. Even any update to the logic doesn't require modification of another class. Its called as hiding implementation details.

Regards,
Ant
Tekchand Prasad
Ranch Hand

Joined: Oct 20, 2005
Posts: 32
Abstraction provides necessary properties and operation of an Entity
Anwar Hussain
Ranch Hand

Joined: Jul 24, 2009
Posts: 35
Hi Ant,

Then every programming language in existance supports abstraction. Is't it??? Abstarction is a feature of OO language.But every language is not OO. Getting my point.

Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

Consider the collection framework that defines the abstraction called java.util.map. It defines an abstract view of an object that maps from one set of objects in to another. Different classes like java.util.HashMap or java.util.TreeMap implements the Map abstraction.
we generally implement abstraction using interfaces or abstract classes, and then provide implementation elsewhere to hide the details.
Anwar Hussain
Ranch Hand

Joined: Jul 24, 2009
Posts: 35
May i know why the implementation details should be hidden. And also whom form you are hiding the implementation details.
The developer who implements the abstraction knows abt the implementation details. Iam confused about this hiding in java.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what are the advantage of abstraction in OOP?