OOP : Object Oriented Programming

Computer programming model that organises software design around data, or objects, rather than functions and logic

Object Oriented Programming is an approach to software development that revolves around real world objects, properties associated with them and the action it performs. It has many benefits to its to it's prior approach of structural programming where the programming was logic oriented.

Principles

Encapsulation

The principle involves wrapping the implementation or capsuling it as a separate block meanwhile exposing only properties and methods that are required.

  • Reduces code complexity
  • Maintenance complexity
  • Easily extendable
  • Easy collaboration
  • Provides an extra security layer for data manipulation

Inheritance

It involves the relationships between classes. For instance if there is a class that has certain methods and properties, and we need another one which shares the same methods and properties. Instead of defining it again, it can simple be inherited from the earlier class, hence will become parent to the new class. This allows a new approach to model the application in a way that we define generic classes as parent classes and then use their properties and methods in non generic classes.

  • Provides reusability of the code

Polymorphism

Involves the code having one structure but different implementation or classes having different functionalities sharing the same interface

  • Modular & extensible code