Professional Documents
Culture Documents
1 OOApproach
1 OOApproach
OOPs concepts.
Java Language Fundamentals
AWT and Swings.
Multi Threading
I/O and File handling
Collection API
Socket Programming
Applets
Introduction to JDBC and RMI
JavaBeans
1
List of Books
Beginning Java 2
Ivor Horton (WROX)
2
List of Books
Java Programming
Language James Gosling et. al.
3
Objectives of This Session
4
Need of Object Oriented Approach
5
Object Oriented Approach
The Claim
6
Structured Method
Functions
and Data
Procedures
Object Object
7
Object Oriented Approach
- The architecture
8
What is an Object ?
9
State of an Object
10
State of an Object
Car Attributes
Color
Average
Make Static
Power
Fuel type
Speed
Values of all attributes
Fuel level
at any moment defines
Tyre pressure Dynamic
the state of the car
Gear
11
Behavior of an Object
12
Behavior of an Object
Window Operations
sasaasasasasasasas
Open
Close
Maximize
Minimize Totality of operations we can
Resize perform upon a window and
Move consequent changes in attributes
Write defines behavior of a window
13
Identity of an Object
14
Identity of an Object
Bank Account
Balance
Interest Rate
Account Number IDENTITY
Customer
15
Responsibility of an Object
16
Bank Account Object
17
Examples of Objects
19
Object Model
5 Major Pillars
Abstraction
Encapsulation
Modularity
Inheritance
Polymorphism
20
Object Model :
Abstraction
Abstraction
21
Object Model
22
Abstraction of a Person Object
{ data, data,.}
attributes
entity object
24
Object Model : Encapsulation
Encapsulation
Encapsulation serves to separate interface of an
abstraction and its implementation
Encapsulation ensures that data within an object is
protected; it can be accessed only by its methods
25
Object Model : Encapsulation
26
Object Model: Modularity
27
Object Model : inheritance
Inheritance
Classification helps in handling complexity
Inheritance is a property of a class hierarchy
whereby each subclass inherits attributes and
methods of its super-class
The subclass can have additional specific attributes
and methods
28
Inheritance hierarchy
Vehicle
Kinetic Scooter
29
Inheritance
Is a kind of Hierarchy
Generalization and specialization are two points of
view that are based on the class hierarchies. They
express the direction in which the class hierarchy is
extended.
30
Containment hierarchy
Car
31
Containment hierarchy
Engine
dsa
Insurance
gdfg
Wheels Registration
32
Object Model : Polymorphism
Polymorphism
The ability of different objects to respond to the
same message in different ways is called
polymorphism
Polymorphism helps us to :
Design extensible software as we can add new
objects to the design without rewriting existing
procedures
33
Polymorphism
Move ( )
Move ( )
Move ( )
Move ( )
34
Object Model: minor elements
3 Minor Pillars
Strong Type Casting : prevents mixing of
abstraction
Eg Bank Slip
Persistence : saves state of a object across time
and space
Eg Local object and object that outlive the
program
Concurrency : many objects responding
simultaneously.
Eg typing into a file & printing some previous file at
the same time
35