Chapter 6 Oops
Chapter 6 Oops
Chapter-6
Introduction:
Object oriented programming is the principle of design and development of programs using
modular approach.
Procedural programming:
Structured programming:
The major drawback is that it is very difficult to model the real world scenario using this model.
Object oriented programming:
1|Page
Chapter 6- Basic Concept of OOP II PUC
member data and the functions that operate on these data known as member function.
Class is the major concept that plays important role in this approach. C lass is a template that
represents a group of objects which share common properties and relations hips.
programming:
Procedural Programming Object Oriented Programming
Large programs are divided into smaller Programs are divided into objects
programs known as functions
Data is hidden and cannot be accessed
Data is not hidden and can be accessed by by external functions
external functions
Follows bottom-up approach in
Follow top down approach in the program the program design
design
Objects may communicate with each
Data may communicate with each other other through functions.
through functions
Emphasize is on data rather
Emphasize is on procedure rather than than procedure
data
Inheritance
2|Page
Chapter 6- Basic Concept of OOP II PUC
Objects
Objects are basic building blocks for designing programs.
Each object is identified by a unique name. Each object must be a member of a particular class.
Objects take up space in memory and have address associated with them.
At the time of execution of a program, the objects interact by sending the messages to one another.
The objects can interact with one another without having to know details of data or functions
within an object.
Classes:
The objects can be made user defined data types with the help of a class.
Classes are user defined data types. A class can hold both data and
functions.
For example: Planets, sun, moon are member of class solar system.
Data Abstraction:
Data Abstraction refers to the process of representing
essential features without including background details or
explanations.
Data Encapsulation:
The wrapping of data and functions into a single unit (class) is called
data encapsulation.
3|Page
Chapter 6- Basic Concept of OOP II PUC
Data hiding is a method used in object oriented programming to hide information within computer
code.
Inheritance:
The derived class shares some of the properties of the base class. Therefore a code from a base
class can be reused by a derived class.
Overloading:
Overloading allows objects to have different meaning depending upon context.
o Operator Overloading
o Function Overloading
Polymorphism:
The ability of an operator and function to take
multiple forms is known as Polymorphism.
Dynamic binding:
Binding is the process of connecting one program to another.
Dynamic binding is the process of linking the procedure call to a specific sequence of code or
function at run time or during the execution of the program.
Message Passing:
In OOP’s, processing is done by sending message to objects.
4|Page
Chapter 6- Basic Concept of OOP II PUC
Message passing involves specifying the name of the object, the name of the function (message)
and the information to be sent.
The programs are modularized based on the principles of classes and objects.
Linking code & object allows related objects to share common code. This reduces code
duplication and code reusability.
Creation and implementation of OOP code is easy and reduces software development time.
The concept of data abstraction separates object specification and object implementation.
Data encapsulated along with functions. Therefore external non-member function cannot access or
modify data, thus proving data security.
Easier to develop complex software, because complexity can be minimized through inheritance.
OOP can communicate through message passing which makes interface description with
outside system very simple.
Disadvantage of OOP’s
Larger program size: OOP’s typically involves more lines of code than procedural programs.
Slower Programs: OOP’s typically slower than procedure based programs, as they typically
require more instructions to be executed.
OOP’s software development, debugging and testing tools are not standardized.
Polymorphism and dynamic binding also requires processing time, due to overload of function
calls during run time.
Application of OOP’s
Computer graphics applications.
.CAD/CAM software
Object-oriented database.
User-Interface design such as windows
Real-time systems.
Client-Server Systems.
5|Page
Chapter 6- Basic Concept of OOP II PUC
Important Questions
2 Marks Question: