SlideShare a Scribd company logo
Object Oriented Programming
OOP Concepts
Comparison of OOP & POP
Procedure Oriented Programming
• Problem is viewed as a sequence of things to
be done such as reading, calculating and
printing
• A number of functions are written to
accomplish various tasks
• Many important data items are placed as
global – they are vulnerable to accidental
changes by functions
Typical structure of procedure oriented
programs
Relationship Between Data and Functions in
POP
Procedure Oriented Programming
• In a large program, it is very difficult to
identify which data belong to which function
• For an external data structure to be revised, all
functions that access the data need to be
revised
• This increases opportunity for bugs to creep in
• POPs do not model real world problems very
well
Comparison of OOP and POP
Procedure Oriented Programming Object Oriented Programming
Program is divided into small parts
called functions.
Program is divided into parts called
objects.
Importance is not given to data but to
functions as well as sequence of
actions to be done.
Importance is given to the data rather
than procedures or functions
Follows Top Down approach. Follows Bottom Up approach
Does not have any access specifier. Has access specifiers named Public,
Private and Protected
Data can move freely from function to
function in the system
Objects can move and communicate with
each other through member functions.
Comparison of OOP and POP contd..
Procedure Oriented Programming Object Oriented Programming
To add new data and function is not easy Provides an easy way to add new data and
function.
Most function uses Global data for
sharing that can be accessed freely from
function to function in the system.
Data can not move easily from function to
function. It can be kept public or private,
so we can control the access of data.
Does not have any proper way for hiding
data; so it is less secure.
Provides Data Hiding. which gives more
security to data
Overloading is not possible. Overloading is possible in the form of
Function Overloading and Operator
Overloading
Example of Procedure Oriented
Programming languages :
C, FORTRAN, Pascal, VB
Example of Object Oriented Programming
Languages :
C++, JAVA, Simula, Smalltalk, VB.NET,
C#.NET, Ada
Object Oriented Programming Definition
OOP can be defined as an approach
that provides a way of modularizing
programs by creating partitioned
memory area for both data and
functions, that can be used as
templates for creating copies of such
modules on demand.
Features of Object Oriented Programming
• Treats data as critical element and does not allow it to flow
freely around the system.
• Programs are divided into entities known as objects
• Data and functions are built around these objects
• Data and the functions that operate on them are tied
together
• Data is hidden and cannot be accessed by external functions
• Objects may communicate with each other through functions
• New data and functions can be easily added whenever
necessary
Fundamental Concepts of OOP
• Object
• Class
• Method
• Modularity
• Data abstraction
• Encapsulation
• Hierarchy
• Inheritance
• Polymorphism
• Dynamic Binding
• Message Passing
• Reusability
• Delegation
• Genericity
Object
• Is a partitioned area of computer memory that stores
data and the set of operations that can access that
data
• Basic run-time entities in OOP
• Represent real-world entities like a person, a bank
account , a list etc.
• Programming problem is analyzed in terms of objects
and the nature of communication between them
• Objects take up space in memory and have an
associated address
Class
• Is a group of objects having identical properties,
common behaviour and shared relationship
• Is a user-defined datatype
• The entire group of data and code of an object
is built using class - class is a model of the
object
• Objects are nothing but variables of the type
class
Method
• An operation required for an object or entity
when coded in a class is called a method
• Class member functions
• Data members of any class uses its member
functions or methods to perform operation
Modularity
• Modularity refers to an organizing structure in
which different components of a software
system are divided into separate functional
units.
• The various components can work together to
form a single functioning unit; but sometimes
they can perform alone as a complete
function, if not connected with each other.
Data Abstraction
• Refers to representing essential features
without including background details.
• Classes use the concept of abstraction and are
defined as a list of abstract attribute ( data
members) and functions ( member functions)
to operate on these attributes.
Encapsulation
• This is the wrapping up of data and functions
into a single unit ( called class ) .
• This restricts access to data from the outside
world; only those functions wrapped in the
class can access it
• This insulation of data from direct access by
the program is called data hiding
Hierarchy
• Hierarchy refers to an organizational structure in
which items are ranked in a specific manner, usually
according to levels of importance.
• Data hierarchy is the structure and organization of
data in a database
• Class hierarchy refers to a family of classes obtained
through inheritance
Inheritance
• Process by which objects of one class acquire the
properties of objects of another class
• It supports the concept of hierarchical classification
• A derived class shares common characteristics with
the base class
• Through inheritance reusability is achieved
• Additional features can be added to an existing
class without modifying it or having to rewrite its
code in the new class
Polymorphism
• Means the ability to take more than one form
• An entity may exhibit different behaviours in different
instances
• In C++, polymorphism is achieved through operator
overloading and function overloading
• Making an operator with operands of basic datatype
do the same operation with user-defined datatypes is
called operator overloading
• Using the same function name for defining different
function is called function overloading
Dynamic Binding
• Binding is the linking of a function call to the
function to be executed in response to the call
• Normally, function calls are linked to specific
functions during compile time (early binding).
• In dynamic binding (late binding), the function
code associated with a given call is not known
until the time of call during run-time.
• It is associated with polymorphism
Message Passing
• Object oriented programs consist of a set of
objects that communicate with each other
• Objects communicate by passing messages
• Message for an object is a request for execution
of a procedure and will invoke a function in the
receiving object
• Message passing involves specifying the name of
the object, the name of the function and the
information to be sent
Reusability
• OOP allows reusability of classes by extending
their features to other classes using
inheritance.
• Reusability saves time and effort
Delegation
• Two classes can be joined by either
inheritance
or by
delegation
In inheritance, one class is derived from another
In delegation, object of one class is used as data
member of another class
Genericity
• This feature allows declaration of variables
without specifying exact data type
• Compiler identifies the data type at run time
• A function that can be used for any type of
data can be created
• Template feature in C++ allows generic
programming
Advantages of OOP
• Object oriented programs can be easily upgraded from
small to large systems
• Through inheritance, redundant code can be
eliminated and extend the use of existing classes
• Data hiding facilitates design and development of
secure programs that cannot be invaded by code in
other parts of the program
• Easy to partition the work in a project based on objects
• Software complexity can be easily managed
Applications of OOP
The promising areas of application of OOP include
• Simulation and modelling
• Object –oriented databases
• AI and expert systems
• Neural network and parallel programming
• Decision support and office automation systems
• CIM/CAD/CAM systems
• Real-time systems
• Hypertext, hypermedia and expertext

More Related Content

Similar to IET307 OOP - object oriented programming concepts.pptx (20)

PPTX
c++.pptxwjwjsijsnsksomammaoansnksooskskk
mitivete
 
PPTX
DSD Unit 1 Abstract Data Type data structures design notes.pptx
yuvaraniit
 
PPT
Unit v(dsc++)
Durga Devi
 
PPT
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
akashsachu221
 
PDF
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
PPTX
1.1-Introduction to Object oriented.pptx
naushigrdcs
 
PPTX
CPP-Unit 1.pptx
YashKoli22
 
PPTX
OOP.pptx
kalyanibedekar
 
PDF
1unit-120324103142-phpapp02.pdf
SahajShrimal1
 
PPT
Basic concepts of object oriented programming
Sachin Sharma
 
PPTX
Object oriented programming 6 oop with c++
Vaibhav Khanna
 
PDF
Unit_2.00000000000000000000000000000.pdf
pateltech13
 
PPTX
Object Oriented Program Class 12 Computer Science
ShailendraPandey96
 
PPTX
SE-IT JAVA LAB OOP CONCEPT
nikshaikh786
 
PPTX
Software_Engineering_Presentation (1).pptx
ArifaMehreen1
 
PDF
C++ chapter 1
jasvinder162
 
PPTX
Programming language paradigms
Ashok Raj
 
PPTX
Need of object oriented programming
Amar Jukuntla
 
PDF
OOPS_Unit_1
Shipra Swati
 
c++.pptxwjwjsijsnsksomammaoansnksooskskk
mitivete
 
DSD Unit 1 Abstract Data Type data structures design notes.pptx
yuvaraniit
 
Unit v(dsc++)
Durga Devi
 
Java Fundamentalojhgghjjjjhhgghhjjjjhhj.ppt
akashsachu221
 
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
1.1-Introduction to Object oriented.pptx
naushigrdcs
 
CPP-Unit 1.pptx
YashKoli22
 
OOP.pptx
kalyanibedekar
 
1unit-120324103142-phpapp02.pdf
SahajShrimal1
 
Basic concepts of object oriented programming
Sachin Sharma
 
Object oriented programming 6 oop with c++
Vaibhav Khanna
 
Unit_2.00000000000000000000000000000.pdf
pateltech13
 
Object Oriented Program Class 12 Computer Science
ShailendraPandey96
 
SE-IT JAVA LAB OOP CONCEPT
nikshaikh786
 
Software_Engineering_Presentation (1).pptx
ArifaMehreen1
 
C++ chapter 1
jasvinder162
 
Programming language paradigms
Ashok Raj
 
Need of object oriented programming
Amar Jukuntla
 
OOPS_Unit_1
Shipra Swati
 

More from BasithAb2 (7)

PPT
spark ignition engines comb s5 ind .ppt
BasithAb2
 
PPT
Thermal engineering emission control s5 ind.ppt
BasithAb2
 
PPTX
Internal combustion engines s5 indu.pptx
BasithAb2
 
PDF
COI - Module -12346481910164101619101 2.pdf
BasithAb2
 
PPTX
presentation211-221102153651-b1da7fce.pptx
BasithAb2
 
PDF
presentation211-221102153651-b1da7fce.pdf
BasithAb2
 
PDF
quasiturbine-170812071211 (1).pdf
BasithAb2
 
spark ignition engines comb s5 ind .ppt
BasithAb2
 
Thermal engineering emission control s5 ind.ppt
BasithAb2
 
Internal combustion engines s5 indu.pptx
BasithAb2
 
COI - Module -12346481910164101619101 2.pdf
BasithAb2
 
presentation211-221102153651-b1da7fce.pptx
BasithAb2
 
presentation211-221102153651-b1da7fce.pdf
BasithAb2
 
quasiturbine-170812071211 (1).pdf
BasithAb2
 
Ad

Recently uploaded (20)

PPTX
Introduction to Indian Writing in English
Trushali Dodiya
 
PDF
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
PPTX
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
PPTX
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
PPTX
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PPTX
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
PDF
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
Introduction to Indian Writing in English
Trushali Dodiya
 
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
How to Configure Re-Ordering From Portal in Odoo 18 Website
Celine George
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
care of patient with elimination needs.pptx
Rekhanjali Gupta
 
How to Create a Customer From Website in Odoo 18.pptx
Celine George
 
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Horarios de distribución de agua en julio
pegazohn1978
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
Vani - The Voice of Excellence - Jul 2025 issue
Savipriya Raghavendra
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
DIGITAL CITIZENSHIP TOPIC TLE 8 MATATAG CURRICULUM
ROBERTAUGUSTINEFRANC
 
Ad

IET307 OOP - object oriented programming concepts.pptx

  • 1. Object Oriented Programming OOP Concepts Comparison of OOP & POP
  • 2. Procedure Oriented Programming • Problem is viewed as a sequence of things to be done such as reading, calculating and printing • A number of functions are written to accomplish various tasks • Many important data items are placed as global – they are vulnerable to accidental changes by functions
  • 3. Typical structure of procedure oriented programs
  • 4. Relationship Between Data and Functions in POP
  • 5. Procedure Oriented Programming • In a large program, it is very difficult to identify which data belong to which function • For an external data structure to be revised, all functions that access the data need to be revised • This increases opportunity for bugs to creep in • POPs do not model real world problems very well
  • 6. Comparison of OOP and POP Procedure Oriented Programming Object Oriented Programming Program is divided into small parts called functions. Program is divided into parts called objects. Importance is not given to data but to functions as well as sequence of actions to be done. Importance is given to the data rather than procedures or functions Follows Top Down approach. Follows Bottom Up approach Does not have any access specifier. Has access specifiers named Public, Private and Protected Data can move freely from function to function in the system Objects can move and communicate with each other through member functions.
  • 7. Comparison of OOP and POP contd.. Procedure Oriented Programming Object Oriented Programming To add new data and function is not easy Provides an easy way to add new data and function. Most function uses Global data for sharing that can be accessed freely from function to function in the system. Data can not move easily from function to function. It can be kept public or private, so we can control the access of data. Does not have any proper way for hiding data; so it is less secure. Provides Data Hiding. which gives more security to data Overloading is not possible. Overloading is possible in the form of Function Overloading and Operator Overloading Example of Procedure Oriented Programming languages : C, FORTRAN, Pascal, VB Example of Object Oriented Programming Languages : C++, JAVA, Simula, Smalltalk, VB.NET, C#.NET, Ada
  • 8. Object Oriented Programming Definition OOP can be defined as an approach that provides a way of modularizing programs by creating partitioned memory area for both data and functions, that can be used as templates for creating copies of such modules on demand.
  • 9. Features of Object Oriented Programming • Treats data as critical element and does not allow it to flow freely around the system. • Programs are divided into entities known as objects • Data and functions are built around these objects • Data and the functions that operate on them are tied together • Data is hidden and cannot be accessed by external functions • Objects may communicate with each other through functions • New data and functions can be easily added whenever necessary
  • 10. Fundamental Concepts of OOP • Object • Class • Method • Modularity • Data abstraction • Encapsulation • Hierarchy • Inheritance • Polymorphism • Dynamic Binding • Message Passing • Reusability • Delegation • Genericity
  • 11. Object • Is a partitioned area of computer memory that stores data and the set of operations that can access that data • Basic run-time entities in OOP • Represent real-world entities like a person, a bank account , a list etc. • Programming problem is analyzed in terms of objects and the nature of communication between them • Objects take up space in memory and have an associated address
  • 12. Class • Is a group of objects having identical properties, common behaviour and shared relationship • Is a user-defined datatype • The entire group of data and code of an object is built using class - class is a model of the object • Objects are nothing but variables of the type class
  • 13. Method • An operation required for an object or entity when coded in a class is called a method • Class member functions • Data members of any class uses its member functions or methods to perform operation
  • 14. Modularity • Modularity refers to an organizing structure in which different components of a software system are divided into separate functional units. • The various components can work together to form a single functioning unit; but sometimes they can perform alone as a complete function, if not connected with each other.
  • 15. Data Abstraction • Refers to representing essential features without including background details. • Classes use the concept of abstraction and are defined as a list of abstract attribute ( data members) and functions ( member functions) to operate on these attributes.
  • 16. Encapsulation • This is the wrapping up of data and functions into a single unit ( called class ) . • This restricts access to data from the outside world; only those functions wrapped in the class can access it • This insulation of data from direct access by the program is called data hiding
  • 17. Hierarchy • Hierarchy refers to an organizational structure in which items are ranked in a specific manner, usually according to levels of importance. • Data hierarchy is the structure and organization of data in a database • Class hierarchy refers to a family of classes obtained through inheritance
  • 18. Inheritance • Process by which objects of one class acquire the properties of objects of another class • It supports the concept of hierarchical classification • A derived class shares common characteristics with the base class • Through inheritance reusability is achieved • Additional features can be added to an existing class without modifying it or having to rewrite its code in the new class
  • 19. Polymorphism • Means the ability to take more than one form • An entity may exhibit different behaviours in different instances • In C++, polymorphism is achieved through operator overloading and function overloading • Making an operator with operands of basic datatype do the same operation with user-defined datatypes is called operator overloading • Using the same function name for defining different function is called function overloading
  • 20. Dynamic Binding • Binding is the linking of a function call to the function to be executed in response to the call • Normally, function calls are linked to specific functions during compile time (early binding). • In dynamic binding (late binding), the function code associated with a given call is not known until the time of call during run-time. • It is associated with polymorphism
  • 21. Message Passing • Object oriented programs consist of a set of objects that communicate with each other • Objects communicate by passing messages • Message for an object is a request for execution of a procedure and will invoke a function in the receiving object • Message passing involves specifying the name of the object, the name of the function and the information to be sent
  • 22. Reusability • OOP allows reusability of classes by extending their features to other classes using inheritance. • Reusability saves time and effort
  • 23. Delegation • Two classes can be joined by either inheritance or by delegation In inheritance, one class is derived from another In delegation, object of one class is used as data member of another class
  • 24. Genericity • This feature allows declaration of variables without specifying exact data type • Compiler identifies the data type at run time • A function that can be used for any type of data can be created • Template feature in C++ allows generic programming
  • 25. Advantages of OOP • Object oriented programs can be easily upgraded from small to large systems • Through inheritance, redundant code can be eliminated and extend the use of existing classes • Data hiding facilitates design and development of secure programs that cannot be invaded by code in other parts of the program • Easy to partition the work in a project based on objects • Software complexity can be easily managed
  • 26. Applications of OOP The promising areas of application of OOP include • Simulation and modelling • Object –oriented databases • AI and expert systems • Neural network and parallel programming • Decision support and office automation systems • CIM/CAD/CAM systems • Real-time systems • Hypertext, hypermedia and expertext