Abstraction & Encapsulation

Abstraction

For example if I say a table you understand the concept it does not matter I I said it was a wooden table or a glass table. Abstraction means that we focus of the certain qualities of something. You have to take what is relevant. For example the taste of a table or the smell of a table are irrelevant

table_PNG6986

Encapsulation

Encapsulation can be defined by the fields of an object and class should only be read or written by the method of that class. Hide some parts of the code except for a few that are most necessary. For example a phone , you don’t care how your phone works, you only care that you can take pictures with it, use apps, watch videos, hear to music, etc.

capsula

I got this out of lynda.com Foundations of Programming: Object-Oriented Design by Simon Allardice

 

Abstraction & Encapsulation

Deja un comentario