object oriented programming

16

Upload: sonybabu

Post on 25-May-2015

1.758 views

Category:

Education


1 download

DESCRIPTION

Principles of OOPS

TRANSCRIPT

Page 1: Object oriented programming
Page 2: Object oriented programming

At the end of this chapter you will know the concepts of

• Languages• Principles of OOPs• Real world and computer software• Object factory

Page 3: Object oriented programming

Object oriented programming•Provides easy approach•Machine independent•Understanding is very easy

High level languages

•Many instructions are written•Instructions are grouped together to form functions•Concentrates much on data items rather than functions

Procedure oriented

•Modular approach•Standardize the program by creating partition memory for both data and function•Reusability of code

Object oriented

Page 4: Object oriented programming

Principles of Object oriented programming

Objects Classes Data Abstraction

Encapsulation

Data Hiding

Inheritance

Polymorphism

Dynamic Binding

Page 5: Object oriented programming

Object

• Unique identity which contains data and functions (Characteristics and behavior)

Characteristic :Colour and shape

BehaviorWrite

Characteristics are considered as data membersBehavior is considered as functions

Page 6: Object oriented programming

Classes

• Class is a set of similar objects • Each object has its own attribute and common

behavior

Rainbow is a class that contains amplitude, frequency, wavelength.Objects are the different colors

Page 7: Object oriented programming

Data Abstraction

• Act of representing the essential features without including the background details

Page 8: Object oriented programming

Encapsulation

• Wrapping up of data and function into a single unit called class is encapsulation.

DATA + FUNCTION = CLASS

Page 9: Object oriented programming

Data Hiding

• Data that cannot be directly accessed outside the class although they are available in the same program.

Page 10: Object oriented programming

Inheritance

• Process by which objects of one class can link and share some common properties of objects from another class.

10

10 A 10 B 10 c

Page 11: Object oriented programming

Polymorphism

• Process of using a function for more than one purpose.

Page 12: Object oriented programming

Dynamic Binding

• Process to link the function call with function signature during run time.

Page 13: Object oriented programming

Object Factory

• Class is a prototype of an object• Each objects has its own properties and

behavior• As the class produces objects of similar type it

is termed as object factory

Page 14: Object oriented programming

Message passing

• Objects interact with each other• They share the common properties and

behavior• This concept is message passing

Page 15: Object oriented programming

Question session

• In OOP stress is given on _______• A _____ is an object maker• Combining data and function to an single entity is

called _______• Object acquiring the properties of another object

is called ______• In procedural programming the stress is on _____• Set of objects that have common attributes and

behavior is called________

Page 16: Object oriented programming

Question answers

What is OOP ? Name any two OOP languagesName the principles of OOPDefine objectDefine a classWhat is data hidingWhich technique can we adopt for data hiding ?What is polymorphismWhat is message passing?Why is class called as object factory.