Beruflich Dokumente
Kultur Dokumente
Concept Of OOP
Prepared
By :
INTRODUCTION
Object-Oriented Programming
Object-Oriented Programming is one of the biggest
programming breakthroughs in recent years, and we could spend
years learning all about Object-Oriented Programming
methodologies and how they can make our life easier than the Old
way of programming. It all comes down to organizing our
programs in ways that echo how things are put together in the
real world.
It has a state.
It may display a behavior.
It has a unique identity.
MOTIVATION OF OOP
The OOP based programming language provides the
tools for programmers to fulfill two principles:
Localize information
The localization of information is supported
by encapsulation the ability to bundle data
and function into self contained objects.
BENEFITS OF OOP
Program code is not repeated, it is reused.
Objects inherit behavior from parent objects.
Objects can override certain behaviors of their parents.
Object oriented programs can be modified much
easier than procedure oriented program
Object oriented programs are scalable.
Continue..
functions
functions
functions
functions
functions
functions
functions
functions
functions
Global Data
Continue..
Method
Object Data
Method
Method
Object Data
Object Data
Method
INHERITANCE
POLYMORPHISM
State
Behaviour
Identity
Continue..
Animals
IMPORTANCE OF INHERITANCE
Subclasses provide specialized behaviors from the basis
Mammal
of common elements provided
by the super classes.
Programmers can implemented super classes called abstract
classes
that define genericMammal
behaviors. Others programmer
Carnivore
Primatefill in
the details with specialized subclasses.
Dog
Cat
Continue..
ClassA
ClassAB
ClassAC
ClassABD
ClassACE
ACE
Object
Continue..
Animal
Mammal
Eat Meal
Carnivore
Eat Meal
Rodent
Dog
Cat
Eat Meal
Primate
Eat Meal