You are on page 1of 21

Assignment:

Analyze the Basic Object Oriented Principles by


comparing to the Real world and programming in front
of your Department Members and students ?

By BruceEckel
Author Of Thinking In C,
Author Of Thinking In C++
Author Of Thinking In Java

My Answer is In the form of Seminar


Basics Of Object Oriented
Programming?

 Introduction

 OOP Terminology

 SDLC
[ Software Design Life Cycle]
OOP Terminology:

1.Objects & Classes


2.Abstraction
3.Encapsulation
4.Polymorphism
5.Inheritance
6.Definition of OOP
7.OOP languages
1.Objects & Classes

Definition: Object is an identifiable entity with


some characteristics and behaviors. It may
represents a person, place ,a thing and so on.
( OR )
Object should be chosen such that they match
closely with Real-World.
Focus On Real-World Example:
Let us say Orange is an Object. Its characteristics
are
characteristics = Spherical Shaped
= Orange in Color
Behavior =Juicy and Sweet
=Preparing Flaviuors &
Chocolates
Focus on Programming Ex:
Characteristics are Represented by its Data and
Behavior is Represented by its Functions

E.g.: STUDENT is an Object


characteristics = Roll no, Name ,Course,DOB.

Behavior = Reading() , Writing().


 In C++ Characteristics=Data=Data Members
Behaviors (OR) Actions =Functions=Member Functions
Characteristics & Behaviors =Members
 In Java we call as Data and Methods.
Class
Definition 1: A class is a Template (or) User-defined
data type which can combine data as well as methods
of an object.
Definition 2: A Class is a set of Objects that share
common data and common Behavior.
Focus on Real life Example:
Let us Consider Rubber stamp is a Class it gives
different imprints. These imprints are nothing but
Objects.
Note : Objects are also the Instance of Class
(According to Booch’s Definition.)

Imprints
(object instances)

Rubber stamp
(object class)
Focus on Programming E.g.:
Let us Consider STUDENT is a Class .The student
may be MCA,MA,B.A ,M.sc etc.
All Charecrastics are considered as data and all
Behaviors are considered to be Member functions
these are placed in the definition of CLASS
i.e.

class student
{
private:
int rollno;
char name[20];
char course[20];
public:
void read( );
void disp( );
};
Abstraction
Definition: It is the process of identifying data members
and member functions of a class relevant to the application
in hand. Identifying essential data members is known as
Data Abstraction .While identifying methods is known as
Procedural Abstraction

Focus on Real-Life Example:

When a person is student


Roll NO
DOB
Course are ATTRIBUTES

When a person went to Bank he has different attributes


Encapsulation
• Definition:Encapsulation is the
most fundamental concept of OOP.
It is the process of hiding data
members by wrapping up of data
and methods as a single unit
(Called Class) to prevent being
accessed by outside world.
POLYMORPHISM

Definition: It is the ability of a function to


take more than one form of a function
can have many forms. Functions name
is same but parameters are different.

Focus on Real-Life Example: Let us


consider the Hollywood Actor Charley
Chaplin he is the one person and can be
acted on different character.
Focus on Programming Example:

Definition: It is the ability of a function to


take more than one form of a function
can have many forms. Functions name is
same but parameters are different.

Focus on Example:
void add(int x,int y)
void add(float x,float y)
void add(int x,int y,int z)
void add(char x,char y)

In the above example void add() is


member function, it can performs
operations on “two int ,two floats, three
int and two chars.”
Inheritance

• Definition: Inheritance is the backbone of


Object Oriented Programming .It is a Process of
deriving a new class from existing Class. The New
Class gets all the properties and methods of
Existing Class.
Super Class: It is class from which a class is
derived. It is also known as “Parent “(or)" base
class”.
.Sub Class: It is Class which inherits its properties
and methods from base class. It is also known as
“child class” (or) “derived class”.

Parent (or)
Base Class

Child (or)
Derived Class
Focus on Real-life Example:

Animal

Amphibians Reptiles Mammals

Human beings Non-Human beings

Amphibians: Animals which lived in water as well as on the earth.


Reptiles: Which Crawls on the Earth.
Mammals: Which gives milk to their Babies.
Person

Employee student Engineer

MCA B.Tech Medicine

From Top to Bottom


Specialization Takes Place

From Bottom to Top


Generalization Takes place
Definition of OOP

Definition: Object oriented Programming is a


method of implementation in which programs
are Organized as a Co-Operative collection of
Objects ,each of which represents an instance
of some class and whose classes are all the
Members of a hierarchy of a classes United via
inheritance Relationships.

OOP languages

 Eiffel
 Small Talk
 Ada
 Java
 Object Pascal
 Objective C
 C++
SDLC
[ Software Design Life Cycle]

• OOA (Object Oriented Analysis )

• OOD (Object Oriented design)


• OOP(Object Oriented Programming)

OOA: It is a process of analyzing and understanding


the problem / system in terms of real-world objects,
their properties and actions.
OOD: It is a processes of modeling the solution to
problem using object oriented concepts. In OOD we
made the abstractions and Mechanisms that provide
the behavior that this model requires.
OOP: Object oriented Programming is a method of
implementation in which programs are Organized as
a Co-Operative collection of Objects ,each of which
represents an instance of some class and whose
classes are all the Members of a hierarchy of a
classes United via inheritance Relationships.
OOA OOD

OOP

Software Design Life Cycle (SDLC)


Customer Request

Write Request

Design

Code

User Test

Redesign

Deliver to Customer
• According to Chinese Proverb
when you hear something ,you will forget it,
When you see something ,you will Remember it
But not until you do something,will you understand it

Any Suggestions, Drawbacks..


Regarding to this Seminar Mail
Me at…

You might also like