OOPS Concepts in Programming

The oops concepts(Object means a real word entity such as pen, chair, table etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes and objects. It simplifies the software development and maintenance by providing some concepts:

Object-Oriented Programming(OOP) is a technique simply saying that allows you to implement that programming dictum: “divide and conquer”. The idea behind OOP is to encapsulate private  data and methods into objects,thereby making  each Object semi-autonomous, and enclose the data and methods in a way that prevents them from cluttering  the general namespace.

1.What is oops?
OOP was primarily introduced to handle large programs by breaking them upto into subroutines.The idea behind breaking  a program is that objects can have multiple subroutines and data inside the subroutines.Encapsulating parts of a program into an object makes it easy to conceptualize the program as a single item,instead of having to deal with the various methods,variables,classes that make up an object internally.

Now here can we understand the concept of  OOP with the help of scenario.

Imagine You have placed in your kitchen several pipes,pumps, a compressor , and all kinds of switches to keep food cool.Every time the temperature of the food gets too high,you turn on the compressor ,open valves and start cranking the pumps manually.Now suppose you wrap all these functionalities into an object say, a refrigerator, in which  all these operations are handled automatically inside the object with proper coordination between the various parts.

Object Oriented Programming (OOP) is a programming paradigm that is based on the concept of objects. An object is a data structure that contains data (fields) and functions (methods).

Object Oriented Programming (OOP)is based on the following concepts:

Classes of objects.
Instances of classes (objects).
Encapsulation – a class encapsulates all the fields and functions that are performed on the fields of a class. The results of encapsulation are:
Restriction to access some of the object’s data from outside of class.
Bundling data to functions inside a class.
The encapsulation is described in details in “C++ Encapsulation” topic.
Polymorphism – a way to use the same interface for the different data types. In simple words it can be described as using the same name for member functions that have different arguments. Polymorphism is not only related to member functions. It’s discussed in more details in “C++ Polymorphism”
Inheritance – a class can inherit some properties from another class. This means that a child class can use some of the functionality of parent class. You can find more information about inheritance in C++ Inheritance.
Abstraction – consists in hiding the details of some processes and data and representing only necessary information and result outside the class. The detailed description of the abstraction concept can be found in “C++ Abstraction”.
Overloading – represents a kind of polymorphism. There is a possibility to overload already existing functions and operators to make them work with new data types. The overloading is described in “C++ Overloading”
Error handling – some of the errors can appear in run time. Because of this, there is a need to handle errors to make programs safe. The mechanism of C++ error handling is described in “C++ Exception Handling”.

2.Why OOPs?

Programming technique which is inspired by real life objects, their properties, attributes and their behaviours.

Their ability to change forms like a man acting as a father and brother at the same time, a man possessing ability to play cricket and drive a car, like a son inheriting traits of his parents in addition to his own unique traits etc. This type of technique provides excellent logical modularity.
OOP is very easily relatable to real life hence making it easier to understand and use for new programmers. Implementing OOPs gives us flexibility,code-re usability and most importantly security.

3.Advantages of OOPs

OOP provides a clear modular structure for programs.
It is good for defining abstract data types.
Implementation details are hidden from other modules and other modules has a clearly defined interface.
It is easy to maintain and modify existing code as new objects can be created with small differences to existing ones.
objects, methods, instance, message passing, inheritance are some important properties provided by these particular languages
encapsulation, polymorphism, abstraction are also counts in these fundamentals of programming language.
It implements real life scenario.
In OOP, programmer not only defines data types but also deals with operations applied for data structures.

3 thoughts on “OOPS Concepts in Programming

  • February 28, 2017 at 1:21 pm
    Permalink

    OK Good, Explain Some real programming example…thanks

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *