Welcome~~~


Another blog:
http://fun-st.blogspot.com/

It is easier to write an incorrect program than understand a correct one.

Saturday, February 12, 2011

Abstraction

<http://azagappan.wordpress.com/2007/04/13/a-quick-refresher-to-oo-concepts-abstraction/>

Abstraction is the process of identifying the relevant details (and ignoring the irrelevant details) of a concept for a particular purpose.

Abstraction is the process of recognizing and focusing on important characteristics of a situation or object and leaving/filtering out the un-wanted characteristics of that situation or object.Lets take a person as example and see how that person is abstracted in various situations

  • A doctor sees (abstracts) the person as patient.  The doctor is interested in name, height, weight, age, blood group,  previous or existing diseases etc of a person
  • An employer sees (abstracts) a person as Employee. The employer is interested in name, age,  health, degree of study, work experience etc of a person. 

What do we mean by relevant details of a concept? Well, layers of details of a concept is really endless. For example, details about the person (concept) can go on and on. Name, date of birth, sex, education,color of eyes, color of hair, height, weigh, employer, driving license, medical history, employment history, work experience, nationality, ethnic background, .. (you can keep going ) are some of the details of a person. But not all of this details are required for a software system (particular purpose). The relevant details of a person when abstracted as student would be name,age, address etc (work experience or driving license details etc are not relevant here). The relevant details of a person when abstracted as Employee would be name,age, address, education, previous employment history etc (ethnic background , color of hair, eyes are irrelevant details here). So, abstraction is the process of identifying relevant details about a concept.

Abstraction is a natural mental process. People understand the world by constructing mental models of portions of it. People try to understand things so that they can interact with them. A mental model is a simplified view of how something works so that you can interact with it.

Mental models are usually simpler than the system(concept) it mimics. For example, a map is the model of a territory. The map is simpler than territory (it doesn't include all the details thats on territory). In otherwords, a map abstracts only the relevant details of a territory. A road map will contain the details about locations and driving directions. A topographical map will contain details about landscape.

Some more information about abstraction can be found on my blog entry What is Data Abstraction?

A very detailed information can be found here -Abstraction, Encapsulation, and Information Hiding



♥ ¸¸.•*¨*•♫♪♪♫•*¨*•.¸¸♥
http://azagappan.wordpress.com/2006/05/26/what-is-data-abstraction/

No comments:

Post a Comment