Introduction to Object Oriented Programming in Python| Part-1

 

Introduction to OOP

Good Software

Before jumping into Object Oriented Programming, let’s understand the word Software.

Software is an easily changeable tool/product that performs a specific task.

The ease of changing or making changes to the software is referred as its softness.

  • A good software should keep the users happy, by delivering what they need.
  • A good software should also keep the developers happy. Ease of making changes (softness) keeps developers happy. So is should be:
    • Easy to understand and make changes.
    • Easy to fix bugs and add new features within the scope.

Object-Oriented Programming System (OOPS) is a way of approachingdesigningdeveloping software that is easy to change.

OOPs

Object-Oriented Programming is a way of approaching, designing and developing software, so that the components of the software and the interactions between them resembles real-life objects and their interactions.

Proper usage of OOPS concepts helps us build well-organized systems that are easy to use and extend.

Describing Real-Life Objects

In Object Oriented Programming, we model software after real-life objects. To be good at modeling software after real-life objects, we should be able to properly describe them.

Let us try describing these real-life objects

The following description is a bad way of describing, as the information of an object scattered and unorganized.

Object 1 is a car and it has four tyres.
Object 2 is a dog and it has four legs.
Object 1 has four doors.
Object 1 can make sound.
Object 2, barks.
Object 1 is in blue color.
Object 2 is in brown

Organized Description

  • In the below description we are grouping the information related to an object.

Object 1 is a car and it has four tyres.
Object 1 has four doors.
Object 1 can make sound.
Object 1 is in blue color.

Object 2 is a dog and it has four legs.
Object 2, barks.
Object 2 is in brown

  • In the below approach, we further organize the information into
    • What the object is?
    • What the object has?
    • What the object can do?

Object 1 is a car
Object 1 has
Four tyres
Four seats
Four doors
and so on …

Object 1 can
Sound horn
Move

The above description shows a simple framework where we describe object by specifying the properties that the object has and actions that the object can do.

Organized Description should be

  • A clear separation of objects.
  • A clear grouping of what object has and what it does.

Comments

Popular posts from this blog

CODING ASSIGNMENT 4

CODING PRACTICE 11 Music Page

CCBP Static Website Coding Assignment 2 Solution | Yoga Page