Object Orientated Programming Concept; The better way

Md. Taiful Islam Tomal
4 min readOct 25, 2018

--

If you are a newbie in programming, want to learn the Object Oriented programming concept from scratch or a professional software developer you can read this article, Surely it will change the way you think about object-oriented programming.

Before I start talking about anything I would like to mention that Object Oriented Programming (OOP) concept and Object-oriented Programming Language are two very distinct things. In short, OOPL is used to implement the OOP concept. We solve the real-life problem using OOP concept and the tool we used to do this is OOPL. In this article, I will only talk about the Object-oriented programming concept, no codes no implementations what so ever. So I cordially request you to forget about the code/implementation using OOP while reading this article. Let’s just dive into the world of Object-oriented concept.

Chapter 1: Object and Class

Object Orientation is consists of two things Object and Class. Now the most conventional definition of this two is

Object is an instance of a class and Class is a blueprint of an Object. Can we really make any sense out of it! If I want to know about the Object, I have to know about class and vice versa. Do I ever get to know this two ingredients of OOP! This is a circular definition, you can’t understand one without other, so it’s difficult to understand any of it from the definition. But to start with OOP you need to understand both of them very clearly. So let’s start with an example.

The image is taken from hideoutbest.com

Suppose you own this wonderful land and decided to build something on it. You went to an architect and told him to make an architectural Design for you. The first thing the architect will ask you what you want to build as it could be practically anything a hospital, a shopping mall or a beautiful house. Now you have to choose something before the architect can make the design.

Now we can understand Object always come before the design. Without having an Object in mind you can’t design anything or make a blueprint. Now if you choose the house the architect will create a blueprint for your house. if you choose hospital the architect will make a blueprint of a hospital and so on. If you have one more land of this size, you can build another house using this blueprint.

Now take a moment and look around you

The image was taken from Pinterest

You will see many objects such as a chair, table, bulb, laptop, mobile, the house etc. In short everything around you is an object. We live in a world full of objects and we only care about the objects. We may break any complex object and will end up getting other smaller objects. Like if we break a smartphone we will get a camera, battery, display, circuit etc. Here camera, battery, display, circuit individually they all are an object. Together they make a complex object. we can further break them into pieces and at some point, we will get electrons and protons. Electrons and protons are objects too, aren’t they! So we can safely say objects are the basic building blocks of this world. The object-oriented concept is taken from real life and Object from OOP is similar to the object from the real world, hence we can say

Objects are the fundamental building blocks of the object-oriented programming and Class is the behavioural and structural definition of the object.

We surely get rid of the circular definition. Now, Like the real world object, any OOP object can have two-component, property and functionality. Let’s take a water bottle as an example. It has many properties like colour, height, width, diameter etc. Its functionality is to carry or preserve water. The property defines the state of the object and functionality defines the behaviour of the object. Class in OOP is the way to design these properties and functionalities of an Object.

Now, are you seeing any blueprint or design of any objects around you? But many of them had blueprint such as the mobile was built from a blueprint, the laptop was built from a blueprint. But do we bother about the blueprints anymore? When your house will be built using any blueprint, will you consider the blueprint important anymore? The answer to those above questions should be “NO”. We don’t bother about the blueprints, what’s important to us is Object. The world is driven by the objects. Like the real world, the OOP world is also driven by objects. Object is the most important thing in OOP, not class. Hence we must see every other OOP concepts through object perspective, not class perspective.

Thank you for reading! I hope you enjoyed so far. Next article is about the four paradigms of OOP. Please continue reading the next part from below link

--

--