You are on page 1of 8

Lecture-2

Object Oriented Programming


Various Programming Paradigms, OOP concepts, Basic Concepts of OOP,
Implementing OOP Concepts in C++, Advantages & Disadvantages of OOP
Programming Paradigms
A programming paradigm defines the methodology of designing and implementing programs
using the key features and other building blocks (such as keywords & functions) of a
programming language.

They refer to the way of implementing and writing the program.


There are 3 paradigms in our syllabus :



Procedural Programming [BASIC, C, FORTRAN]
In Procedural Programming , our main focus is on the procedure rather than data.
We don’t care about the data used in the program, our main motive is to make
the program run faster and effectively.
e.g. If we want to make a program that tells us about the average marks of a
student in 5 subjects in a school.
Our focus will be on how to calculate that faster and without using much
memory.
* We don’t care about storing and organising the marks class-wise or about the
representation of the program.

Design change and upgradation are difficult.


Some methods to focus on Data
● Data Abstraction : showing only necessary parts of the program.
● Data Encapsulation : binding of data into a single capsule (class).
● Modularity : partitioning the program into individual components.
● Inheritance : making a father-son relation between two class
● Polymorphism : processing data in more than one form
Object Based Programming[ RUBY, C# ]

Programming Paradigm in which Abstraction, Encapsulation and Modularity are


used are Object Based Programming.

Which further basically means use of CLASSES.


*Object Oriented Programming[ C++, JAVA, SIMULA]

Programming Paradigm in which Abstraction, Encapsulation,Modularity ,Inheritance and


Polymorphism are used are Object Oriented Programming.

Which means use of class, inheritance and overloading all are supported.
Advantages & Disadvantages of OOP
● Re-use of Code
● Ease of Comprehension ( Similar to real world models )
● Ease of fabrication and maintenance
● Easy Redesign and extension
➔ Relation in classes becomes artificial sometimes
➔ OOP design is tricky
➔ Requires good design, programming & thinking in terms of object skills
Practice Questions
( V.V. Important )
1. **Difference between Procedural Programming & Object Oriented Programming.
2. **Discuss major OOP concepts briefly.
3. Define the following : -
a. Data Abstraction/Hiding
b. Data Encapsulation/Binding
c. Polymorphism
d. Inheritance
e. Modularity

You might also like