[RESOLVED] Definition for Abstraction
Hi,
I'm confusing with concept "Abstraction". I go through few articles on the web and consider it as follows.
"Abstraction is a process which software developer consider about an object in terms of its functionality. No need to worry about its implementing details"
Can you guys comment on this?
Re: Definition for Abstraction
Hi eranga!
You may think of abstraction as a way of making good documentation for your methods, before implementing them.
Say you write some code, and someone else is to change it! It would be optimal for this other person that your methods is well documented, so that he/she does not have to sit down and study your code. It will save him/her some time, right?
With the use of procedural abstraction, you specify each method clearly before you implement it. By specifying post- and preconditions, as well as the method's parameters, others will be able to use the method without studying the implementation. In fact, you do this every time you use a method from the Java API. Have you ever looked at the code for 'println()' or 'sqrt'?!
So, in shorter terms, you have to find out what your methods are going to do, before you think of how they are going to do it.
Re: Definition for Abstraction
Dear Mutuz,
How nice your comment. Thanks a lot.
You said that APIs are doing this. I mean, everyone can used those APIs without worring about its implimentation. Isn't it?
Re: Definition for Abstraction
Quote:
Originally Posted by eranga262154
You said that APIs are doing this. I mean, everyone can used those APIs without worring about its implimentation. Isn't it?
Yes, you have learned how to use certain methods by reading the API. This is because the API describes the methods/classes so well, that you don't have to look at it's code.
Re: Definition for Abstraction
Ok thanks Mutuz, Now i got the point.
Re: Definition for Abstraction
If I want to look-at APIs code what should I do?
Re: Definition for Abstraction
Abstraction
To take a look at the API code, unzip the "src.zip" file in the JDK folder, it has all java source code
Re: Definition for Abstraction
Thanks for your link on wikipedia. I also refer the same page.