Object-Oriented Programming Concepts (OOPs) Simplified! ! !
Tags: computerscience, oop, node
Published: 2020-06-21 19:51:49

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8ch1sn08hzxw40v6zssd.png)
===========================================================

In this article, I would like to introduce a beautiful programming paradigm that solves a lot of real-life problems in terms of programming.

Let us look into what is OOPs, the ideology behind OOPs and also main concepts of OOPs. And the complete article would be described in Non Programming terms, i.e., in layman’s terms.

**_Note:_** Once you are done reading the article, and understand, learning the OOPs Languages would be easy. It would give better understandability to learn any OOPs languages.

**_What is OOPs?_**

Object-Oriented Programming is a programming paradigm/ way of writing a solution for a given problem statement.

In a simpler way, it is a way of writing computer programs that are using the idea of “**_Objects_**” as a reference to represent the data and methods.

**_Instance:_** Take a scenario, Building a car. Building a car has a lot of things that are to be taken care of.

1.  Drawing out a blueprint of how the car should look like.
2.  Things that are required to build a car.
3.  Things that should be accessible to the one who builds it.
4.  Things that are accessible to one who drives it.
5.  How things attached to it should function
6.  How different things help function the other things

Here **_things are the data_** and **_methods are functionality associated with that data_**. Object-Oriented Paradigm basically is an idea of binding both the data and functionality for the simplicity of finding real-world problems.

Basically, some real-world problems are efficiently solved when taken Object-Oriented Approach, say in the above instance, Building the car was the problem statement.

How we go about it, can be understood as we go ahead.

You might have read the term “**_Object_**” above. Wondering, what is an **_Object_**?

An **_Object_** is the **_basic fundamental unit of Object-Oriented Programming_**. It’s a unit formed by the data and the methods(things and how things function) which is built from a **_blueprint_**.

Taking the same instance as above, we can say, **_Car is an Object._** It holds all the things and functions together to have the behavior of a vehicle.

Talking about Blueprint, reminds of another important term, “**_Class_**”, which basically is a blueprint for creating objects.

For instance, for a Car Blueprint, we take care of essential features like fuel, type of fuel, the engine to be used, design how it should look, on Ignition how the vehicle should function.. so on.

It’s possible to produce cars in series using the blueprint, without re-building the machine from scratch.

This basically gives a clear image of what **_OOPs_** is all 
about.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9i6pgmxua4s9hvp991r1.PNG)

Now, taking note of the major features of OOPs concepts:

*   Abstraction
*   Encapsulation
*   Inheritance
*   Polymorphism

What do you mean by “**_Abstraction_**”?

It simply means showing the essential features of a module, hiding the details of internal functionality.

Example: A driver that uses the accelerator, doesn’t need to know how it precisely works at the Mechanic level. He only knows that if he presses the accelerator, the car accelerates.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hzlj0ltznczreyklx388.png)

Water is composed of Hydrogen and Oxygen, but we see is liquid water (Abstraction)

Now jumping into another term, “**_Encapsulation_**”,

It is a method of wrapping up the things (data) and in a way, it can function to do something productive(methods). Basically, putting together the data and methods together to classify them.In other words, we can also define it as, way of exposing a solution to a problem without requiring to fully understand the problem domain.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8g2hfzp48qvwfr88a80e.png)

Class/Interface is one of the features that help implement Encapsulation at the programming level.

Example: In the Car designing/Integrating team, the members working on the Lighting system of the car don’t need to know how the Brake System in the car works, as simple as that.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/9ihigfkhncsvrzuphuqd.jpg)


Now, explaining the term “**_Inheritance_**”

“**_Inheritance_**”, as the word suggests is a way to inherit some features(methods) or things(data) from a parent to its child. This is an important feature in OOPs, which basically deals allows you re-define the model.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7f8vmu270oca4ootapfg.gif)

Another Example: There is a Car X and are planning to release a Model A and Model B for Car X.  
Now Model A is already designed and implemented. Model B is almost the same except for the Tyre and Disc Brake System.  
So, here what happens is, Model B can take the design of the Model A and alter as per their requirement for Tyre and Disc Brake System.  
Made sense? They don't have to redesign it from scratch. Instead, they inherit the things and functionality from Model A.

Finally, talking of “**_Polymorphism_**”

**_Polymorphism_** is a feature that defines the different implementation of the same objects.

To put in simple words, “**_Polymorphism_”** is a feature that enables to define the same functionality in different forms.

Simple silly but effective example would be using 'Cut' as a polymorphic word;

   - Surgeon would begin to make an incision
   - Hair Stylist would begin to cut someone's 
     hair
   - Actor would abruptly stop acting of the 
     current scene

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/jkt0xrsigy5hyauxq6fy.jpg)

Another Example: Car X has Model A and Model B, where both need fuels to run the vehicle.

Say, Car A-Model A uses petrol and other uses diesel as its fuel. Hence, the design of Automotive Engine design varies though they perform the same functionality.

This is how simple OOPs concepts are. I hope you got at least little clarity on what OOPs is and what their features are.

This basically speaks OOPs in general terms. 

If you really want me to write down the explanation of the OOPs in the programming point of view. 

Drop comments.
This is a revised version of [my Medium Post](https://shravan20.medium.com/object-oriented-programming-concepts-oops-simplified-6a45f3de81ad)

Stay Tuned for more posts. 
Connect me [mrshravankumarb@gmail.com](mrshravankumarb@gmail.com)