The Four Pillars of OOP

Object Oriented Programming (OOP) is a programming system in which functionalities written for a system are designed around its affected data.

That is, the process of programming is done using interacting objects (unit components consisting of data and functions that act on them) compared to the procedural process in which systems are built from instruction to instruction.

The four fundamental principles that must be employed in order to build systems of interacting objects are: Abstraction, Encapsulation, Polymorphism and Inheritance.

Abstraction

Abstraction in object oriented programming is the process of modularizing, dividing large systems into smaller sections. Abstracting code is essentially packing code with similar functionality together into simple modules (objects) and interacting with them through those packets. In programming, abstraction can be achieved through the use of packages, classes, interfaces and methods.

Abstraction reduces code complexity thus making the code more readable. It also enhances code reuse and allows for improvement and modification without the fear of colossal errors.

Encapsulation

Encapsulation describes the practice of strictly enclosing data and functionality into their modules and only exposing functionality that are most necessary for external use. This is the black box model, in which data and code that acts on it are linked together and enclosed.

A major advantage of encapsulation asides that it further enhances modularity is that, encapsulation protects designed functionalities and data as restricting access to them prevents random modifications that ultimately create errors.

Polymorphism

Polymorphism in OOP describes the ability to reuse code functionality with minimal repetitions while providing the option of modification. It is simply based on the premise: one code, multiple uses. Polymorphism relies heavily on the principle of abstraction.

Inheritance

Inheritance further extends the polymorphism objectives of the object oriented paradigm. Inheritance is the procedure in which different classes /objects are able to obtain the properties of another class. Inheritance models the parent-child system in which the child is a branch of the parent classes and inheriting some functionality while also possessing its unique properties.

The use cases of inheritance are often found where the parent class represents the family while the sub classes represents types/off-shoots of that family (is - a relationship) in which the parent classes define general functionality while the sub classes define specific functionalities.

The implementation details of these principles vary from language to language. For example in java, a subclass can only inherit from a single class while python allows for multi parent classes.