2.1 Abstraction


1. Abstraction is a main concept in the object-oriented programming paradigm.
2. It is concerned with identifying the crucial behavior of an object and eliminating irrelevant details.
3. For example, in a library management software,
a. A member object is required to represent a library member.
b. Such member is a person with many characteristics including name, address, affiliation, size, weight,
hobbies, etc.
c. However, for the purposes of the library software, the member object could only need to contain the id,
name, address and the affiliation of the person.
d. Other person information are irrelevant to the application of concern and thus can be abstracted away.
4. Thus, abstraction is a way to control complexity in the object-oriented design hiding away unnecessary
details.
5. It is to be noted that the level of abstraction may vary based on the application.
6. For example,
a. The member object in a social networking application would need to include more details on the
person than in the library software such as the person's hobbies.