Monday, April 23, 2012

What is Abstraction

Notes from my guru Sandeep Karan sir.

Definition of Abstraction:
Abstraction is a process of reducing the information content of a concept, typically to retain only information which is relevant for a particular purpose.

An abstraction is "a simplified description of a system that emphasizes some of the system's details or properties while suppressing others. A good abstraction is one that emphasizes details that are significant to the user".

creating abstraction can make code more reliable and easier to maintain.

Abstraction is simply separating the top level usefulness of a thing from the details of its implementation. As a user of a control, you really don't care how the control does its job, what kernel operations it invokes, what interrupts it might raise. You only care what methods it has for you to call, and what results to expect of them. That's abstraction at work; keeping the details away from the consumer of the object, so that the programmer is freed from worrying about details that aren't relevant to his assignment.

Lets consider the example of String class. If the type is of the String then it will definitely support the operations like Concat, IndexOf, Substring, etc. In this case, the operations supported by the entity depends on its type. This is known as abstractions.

still not complete, please re-visit after some time, we are sorry

No comments:

Post a Comment