Difference between Data Encapsulation vs Abstraction

Encapsulation has two faces; data abstraction and information hiding. Data abstraction is a type seen from the outside. Information hiding is a type seen from the inside.

 

 

Sometime encapsulation is used to mean information hiding only but I think the definition I gave is better because if you encapsulate something you get both an inside and an outside right.

————— In Short —————-

Abstraction focuses on the outside view of an object (i.e. the interface)Encapsulation (information hiding) prevents clients from seeing its inside view, where the behavior of the abstraction is implemented.

Advertisements

9 Comments »

  1. 1
    Anthony Says:

    There are 100s of postings and forums just confusing the two concepts. I think what Giri is posted is short and sweet.

  2. 2
    NIKHIL Says:

    HI GIRI,
    WHAT YOU TOLD IS RIGHT, ITS SWEET SIMPLE AND APT DEFINITION DESCRIBING THE ACTUAL DIFFERENCE BETWEEN THE TWO MOST CONFUSING SUBJECTS.

  3. 3
    Dev Says:

    Best and to the point

  4. 4
    shagun suhail Says:

    thanks a ton. i had to submit my assignment tommorow!!@!

  5. 5
    JOYJSARK Says:

    The concept is still not clear. Hope you can elaborate this matter.

  6. 6
    Preeti Says:

    Very lovely ans…………..

  7. 7
    Nitya Says:

    after 3 yrs of exp. now i really understand the difference. thanks

  8. 9
    Krantisinh Deshmukh Says:

    thanks a lot giri…. u made those two concepts simple…!


RSS Feed for this entry

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

%d bloggers like this: