Lesson 1 - Introduction to Object Oriented Concepts.pptx
dikshaprabhugvm
9 views
27 slides
Feb 26, 2025
Slide 1 of 27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
About This Presentation
Polymorphism, derived from Greek, means "many forms." In Java, it allows a single interface to represent different underlying data types. This means that a method can perform different tasks based on the object that invokes it.
Size: 648.81 KB
Language: en
Added: Feb 26, 2025
Slides: 27 pages
Slide Content
OBJECT‐ORIENTED CONCEPTS Unit – 1 : Object Oriented Programming Paradigms
Object‐Oriented Concepts Objectives: To learn & understand the difference between Procedure Oriented Programming & Object Oriented Programming To learn & understand the concepts of Object Oriented Programming
Different Programming Paradigms Functional/procedural programming: – program is a list of instructions computer to the Object‐oriented programming – program is composed of a collection objects that communicate with each other
Object‐Oriented Concepts Data Object = Data + Methods
Object‐Oriented Concepts
Decompose problem in entities called Objects Objects communicate through methods New data & methods can be easily added Follows bottom‐up approach in program design Object‐Oriented Concepts
Definition: Object Oriented Programming is an approach that provides a way of modularizing programs by creating partitioned memory area for both data & functions that can be used as templates for creating copies of such modules on demand Object‐Oriented Concepts
Objects: Run time entities in an object oriented system E.g.: Person, Bank Account, Table of Data User defined data type – Vectors & Lists Objects interact by sending messages ‐ customer object may send a message to account object requesting for balance Object‐Oriented Concepts
Each object contains data & code to manipulate the data Objects can interact without having to know each others data It is sufficient to know the type of messages accepted & type of response returned by the objects Object‐Oriented Concepts
Class: The entire set of data & code of an object can be made as a user defined data type using the concept of Class. Class may be thought as a “ Data type ” & objects as “ Variables ” Object‐Oriented Concepts
Once a class is defined, any number of Objects belonging to the class can be created Each object is associated with the data of type class with which they are created A class is thus a collection of objects of similar type An object is an instance of a class Object‐Oriented Concepts
Object‐Oriented Concepts Basic Concepts Classes A class is a collection of objects of similar type E.g.: Person, Bank, Account
Object‐Oriented Concepts Basic Concepts Objects An object is an instance of a class E.g.: Class obj = new Class(); Bank b1 = new Bank();
Object‐Oriented Concepts Basic Concepts Data Abstraction Refers to the act of representing essential features without including the background details
Object‐Oriented Concepts Basic Concepts Encapsulation Refers to wrapping of data & methods into a single unit called class Data is not accessible to outside world & only methods which are wrapped in the class can access it.
Object‐Oriented Concepts Basic Concepts Encapsulation This methods provide interface between the object’s data & program Also know as Data Hiding
Object‐Oriented Concepts Basic Concepts Inheritance Is a process by which object of one class acquires the properties of object from another class
Object‐Oriented Concepts Basic Concepts Polymorphism Ability to take more than one form Operation may exhibit different behavior in different instances E.g.: Single function name can be used to handle different types & number of arguments
Basic Concepts Dynamic Binding Binding refers to linking of procedure call to the code to be executed in response to the call. Dynamic Binding means that the code associated with a given procedure call is not known until the time of the call at runtime Object‐Oriented Concepts
Object‐Oriented Concepts Basic Concepts 8. Message Communication A message for an object is an request for execution of a procedure. Sending Object Receiving Object Message
Set of objects communicate using the following steps: Creating classes that define objects & their behavior Creating objects from class definitions Establishing communication among objects Object‐Oriented Concepts
Object‐Oriented Concepts Benefits of OOP Eliminate Redundant Code Build Secure Programs Multiple object coexist without any issues Easy to modularize the work Easy to upgrade
Object‐Oriented Concepts Benefits of OOP Easy to manage software complexity Communication through message helps make interface simple passing
Object‐Oriented Concepts Applications of OOP Real Time System Simulation & Modeling Object Oriented Databases AI & Expert System Decision Support & Office Automation System
Object‐Oriented Concepts Procedural v/s Object Oriented Programming Concepts of OOC Benefits of OOC Applications of OOC