--Originally published at richardctc201
Yesterday I saw the video in Lynda that the professor suggested us where there are defined some basic concepts of Object-Oriented Programming. There were two special elements that are in the list of Mastery topics: abstraction and encapsulation. These two are essential in understanding the functionality of a class, and therefore how are they built.
The first one, abstraction is the action of focusing on the essentials, and discarding what is unimportant or irrelevant. Abstraction is having the most general idea about something without entering in details, centering in the essential qualities of this idea. One clear example could be the idea of a banana: the most general idea of the banana includes color, shape, and maybe flavor. The attributes that are unimportant when thinking about a banana are probably chemical concepts like density, acidity, and what it is made of.
The other element, encapsulation is referred to the action of not only putting the attributes and methods in one same place (a class), but protecting them. The basic ‘law’ of an OOP is that an object must hide all its information except from the data that is absolutely necessary to expose. This action of encapsulating the attributes of an object is useful because it reduces dependencies that many parts of the program may have in just one class or one tiny part of the program.
I would continue seeing the suggested videos in Lynda and posting here about them.