principles and advantages of oop ppt

16
Object Oriented Programming With C++ Principles and advantages of oop

Upload: daxesh-chauhan

Post on 07-Aug-2015

138 views

Category:

Engineering


27 download

TRANSCRIPT

Page 1: Principles and advantages of oop ppt

Object Oriented Programming With C++

Principles and advantages of oop

Page 2: Principles and advantages of oop ppt

CONCEPTS OF OOP

• Class

• object

• Inheritance

• Abstraction

• Encapsulation

• Polymorphism

Page 3: Principles and advantages of oop ppt

CLASS

• A class is a collection of objects of similar type.• Example:- mango, apple and orange are members of the

class fruit.• Classes are user-defined data type and built-in

type of a programming language. • fruit mango: will create an object mango belonging to the

class fruit

Page 4: Principles and advantages of oop ppt

OBJECT

• Object are the basic run time entity in an object –oriented system.

• They may represent a person, a place, a bank account, a table of data or any item that program has handle.

Page 5: Principles and advantages of oop ppt

Example of objectsOBJECT : emp

DATA : Emp_noNameAgeSalary

FUNCTIONS : Getdata (input)Total (find total salary)Display (output)

Page 6: Principles and advantages of oop ppt

INHERITANCE

It is the capability of one class to inherit properties from another class.

5 types of inheritance Single level Multilevel Multiple Hierarchical Hybrid

Page 7: Principles and advantages of oop ppt

Single level inheritance

Base classFlower

Rose Derived class

Single level

Page 8: Principles and advantages of oop ppt

Multi level inheritance

Base class

Rajasthan

Jaipur

World

India

Multi level

Page 9: Principles and advantages of oop ppt

Multiple inheritance

Bird

Parrot Sparrow

Multiple inheritance

Base class

Derived class

Page 10: Principles and advantages of oop ppt

ABSTRACTION

Definition- The act of representing essential features without including the background details or explanations.

• Classes uses the concept of abstraction and are defined list of abstract attributes.

• The attributes are sometime called as data members because they hold information.

• The function that operates on these data are sometimes called methods or member function.

Page 11: Principles and advantages of oop ppt

ENCAPSULATION

• Definition :- The wrapping up of data and functions into a single unit.

• Data encapsulation is the most striking feature of class.

• Encapsulation means that some or all of an object's internal structure is "hidden" from the outside world.

Page 12: Principles and advantages of oop ppt

POLYMORPHISM

•polymorphism is the ability of objects of different types to respond to functions of the same name.

Page 13: Principles and advantages of oop ppt

Types of polymorphism

• Virtual functions.• Operator overloading.• Function overloading.

Page 14: Principles and advantages of oop ppt

ADVANTAGES OF OOP

• Through inheritance, we can eliminate code and extend the use of existing classes.

• Reusability.• Easy to understand.• Models the real world well.• The principle of data hiding helps the programmer to

build secure programs.• Software complexity can be easily managed.

Page 15: Principles and advantages of oop ppt

• It is essay to partition the work in a project based on object.

• Software complexity can be easily managed.• Object –oriented system can be easily upgraded from

small to large system.

Page 16: Principles and advantages of oop ppt