SHASHANGKA SHEKHAR'S BLOG

Hi, I am Shashangka Shekhar, Working with Microsoft Technologies. This is my personal blog where I share some of my experiences.

Encapsulation VS Abstraction

This is a bit confusing while both are like same, cause the definition  where abstraction is showing only necessary and the encapsulation is hiding complexity.

It’s seems that they are similar, but actually they’re not, here’s how they are differ:

Abstraction:

  1. Abstraction is a concept of hiding mechanism (কি লুকাব)
  2. Only showing those parts which is necessary.
  3. It is a thought process that is solve in design level.

Encapsulation:

  1. Encapsulation is the implementation of that concept(কিভাবে লুকাব)
  2. Hiding complexity.
  3. Here it is actual process of hiding that is solve in class level.

Real world Example:

EncVAbs

Refrigerator :

  1. Refrigerator Freezing is concept.We Knows only cooling or not cooling (Abstraction).
  2. How it is done user need not to know (Encapsulation)

Mobile Phone:

  1. We operate phone using touch screen (Abstraction). We only need to know it’s touch which is working or not!
  2. We don’t know how the internal mechanism of touch responding circuit connection (Encapsulation).

Post a comment