Object Oriented Programming : Fundamentals

There are various programming paradigms used for building software depending upon the requirements of the software we are building. However the most common approach used these days is the Object Oriented Programming approach. Some most common programming languages that uses this approach are : C++, JAVA, Python, Ruby and Visual C++

In this approach the problem is viewed in terms of ‘Objects’ rather than procedures as in procedural programming. The most important question in this approach is what we should consider as an Object in order to solve the problem.

The answer is simple, any identifiable entity having some properties and behaviour is an Object. It can be a car, a person, an apple etc.The whole idea behind this approach is the make programming closer to the real world thereby making it a natural way of programming

What is a Class?

A class is a group of objects having common properties and behaviour. It is basically a blueprint to create an object.

For example - consider the example student object, there can be a no. of students who share similar properties and behaviours, so this group of students can be called as a ‘class’

Object Oriented Programming(OOP) Concepts

Before we dive into the world of Object Oriented Programming we need to understand some basic concepts which we use in Object Oriented Programming

Abstraction

The process of showing only relevant information without including the background details is called abstraction. A class uses this concept to hide its complexity from the outside world.The user is only concerned about what an object of a class can do, not how it does.

Polymorphism

It simply means one entity in many forms. It is the ability of an operator or function to work in various forms i.e, a single function or operator behaves differently depending upon the data provided to it

Inheritance

It is the process of forming a new Class from an existing class. It is the most useful characteristic of Object Oriented Programming as it promotes code reusability.

Encapsulation

The process of combining the data and its associated functions into a single unit is called Encapsulation. It is implemented through Classes.