OOP Concept: Abstraction & Encapsulation

Abstraction refers to the act of representing essential features without including the background details or explanations.

Abstraction focuses on the observable behavior of an object. I have found this blog post that explains abstraction in more details : http://brevitaz.com/abstraction-in-java/

The wrapping up of data and functions into a single unit (called class) is know as encapsulation.

Data encapsulation is the most striking feature of a class. The data is not accessible to the outside world and only those functions which are wrapped in the class can access it. These functions provide the interface between the object’s data and the program.

The insulation of the data from direct access by the program is called data hiding.

Edward V. Berard in his article Abstraction, Encapsulation, and Information Hiding concluded saying:

Abstraction, information hiding, and encapsulation are very different, but highly-related, concepts. One could argue that abstraction is a technique that helps us identify which specific information should be visible, and which information should be hidden. Encapsulation is then the technique for packaging the information in such a way as to hide what should be hidden, and make visible what is intended to be visible.

Advertisements
OOP Concept: Abstraction & Encapsulation

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s