Sie sind auf Seite 1von 18

Seminar On

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.

Object-Oriented approach, an object has the following


characteristics:

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.

Exploit existing solutions


Exploitation of existing solution is supported by the
language being extensible in several powerful ways,
meaning that reuse and modification is easy.

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.

OOP Vs Traditional Procedural Programming


By a stepwise refinement process, break the task to
be performed into subtasks, and these into smaller
subtasks, until the subtasks are simple enough to be
implemented directly (this is the top down approach).
Write procedures to solve simple tasks and combine
them into more sophisticated procedures, until we
have the functionality we want (this is bottom down
approach).

Continue..
functions
functions
functions
functions
functions
functions
functions
functions
functions

Global Data

Continue..
Method

Object Data
Method

Method

Object Data

Object Data

Method

Features of OOP technology


OBJECTS
Objects are the heart of object orientation. An object is a
CLASSES
representation of almost anything we need to model in a
program. Objects are software bundles of data and related
DATA ABSTRACTION
procedures.
It is an identifiable entity with some
characteristics and behavior. An object can be a model of an
DATA ENCAPSULATION
employee,
a representation of a sensor , a window in a user
interface, a data structure such as a list, virtually anything.

INHERITANCE

POLYMORPHISM
State

Behaviour

Identity

Features of OOP technology


CLASSES
Classes and objects are closely related, but are not the same
thing. A class is a description or definition of the
characteristics of the objects that belong to the class. So a class
is a group of objects that shares common properties and
relationship.
Ex.
About a departmental store.
The classes that have been identified are in dept. store are:
Counter
Def:- Abstraction refers to act of
Salesperson
representing essential features without
Product
Customer including the background details or
explanations.
Payment

Features of OOP technology


DATA ABSTRACTION
Def :- The wrapping up of data and functions (that operates
on the data) into a single unit (called class) is known as
encapsulation
The benefits of encapsulation :
Modularity
Information hiding

Features of OOP technology


DATA ENCAPSULATION
Role of inheritance in OOP :
a) Its capability to express the inheritance relationship
which makes its ensure the closeness with the real world
model.
b) Another is the idea of reusability. Inheritance
allows the addition of additional features to an
existing class without modifying it.
c) The third reason is its transitive data natures.

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

Features of OOP technology

For a class hierarchy, it is possible for different subclasses


to be derived from a common superclass. Each of the
superclasses can override and extend the default
properties of the superclass differently. Polymorphism, is
a characteristics of inheritance that ensures that instances
of such superclasses behave correctly. So, Polymorphism
is defined as the ability of related objects to respond to
the same massage with different, but appropriate actions.

Continue..
Animal

Mammal
Eat Meal

Carnivore
Eat Meal

Rodent

Dog

Cat
Eat Meal

Primate
Eat Meal

Overview of some of the languages


C ++
Smalltalk
JAVA

Das könnte Ihnen auch gefallen