Object Oriented Programming: Basic Principles

Thursday, November 3, 2011

 

Abstraction – a program is the ability to ignore some aspects of handling information that being able to focus on essentials. Each object in the system acts as an "actor" abstract, which can perform actions can modify and communicate status and communicate with other objects in the system without revealing how those facilities were implemented. Processes, functions or methods can also be abstract, and in this case a variety of techniques are needed to expand the abstract:
Encapsulation – also called information hiding: Ensures that objects cannot change the internal state of other objects directly (but only by methods provided by the object), only the object's methods can access their status. Each type of object exposing an interface for other objects that specify how those objects can interact with it.
Polymorphism – The ability to process objects differently depending on the type or class. More specifically, the ability to redefine methods for derived classes. For example, Figure we can define a class method area. If the circle, rectangle, etc… Figure class will expand; they can redefine the method area.
Heritage – Organizes and facilitates polymorphism and encapsulation, enabling the definition and creation of specialized classes based on class (general) already defined – they can share (and extend) their behavior without the need of redefining. This is usually done by grouping objects into classes and defining classes as extensions of existing classes. The concept of inheritance allows the construction of new classes, which retains the characteristics and behavior, so data and member functions from one or more previously defined classes called base classes, it is possible to redefine or add data and functions. Use the idea: "Some objects are similar, yet different." A class heiress of one or more base classes is called the derived class. The essence of heritage lies in the possibility to reuse things that work.

Leave a Reply