1. Principles of OOP
Presented by
D.Seethalakshmi MCA.,M.Phil.,
Assistant Professor
Bon Secours College for women
Thanjavur.
2. Principles of OOP
Objects
Classes
Data abstraction and encapsulation
Inheritance
Polymorphism
Dynamic binding
Message passing
3. Objects
o The basic run time entities in object oriented system.
It represent a person, a place, a bank account or any item that the
program has to handle.
Student
Average
Display
Total
Object: Student
DATA
Name
DOB
Marks
FUNCTIONS
Total
Average
4. Classes
The entire set of data and code of an object can be made of user
defined data types with the help of class.
Once class has been defined we can create number of object
belongs to that class.
A class is a collection of object of similar data type.
Example:
Fruit mango;
5. Data Encapsulation
The wrapping up of data and functions into a single unit (called Class) is
known as encapsulation.
Only access those functions which are wrapped in the class.
The insulation of the data from direct access by the program is called
data hiding and information hiding.
6. Data Abstraction
It represents essential features without including the background details or
explanations.
It defined as a list of abstract attributes. Its sometime called data member
because it holds information.
This functions are called as methods or member functions.
Abstraction is known as Abstract Data Type(ADT)
7. Inheritance
Inheritance is the process by which objects of one class acquire the
properties of objects of another class. It supports the concept of
hierarchical classification.
Bird Flying bird Robin
8. Polymorphism
An operation may exhibit different
behaviors in different instances. The
behavior depends upon the types of
data used in the operation.
Polymorphism, a greek term means
ability to take more than one form.
To be continued…
9. Operator overloading &
Function overloading
The process of making an operator to exhibit different behaviors in
different instances is known a operator overloading.
Example: two numbers operation sum
A single function name to perform different types of tasks is known
as function overloading.
10. Dynamic Binding
Binding refers to the linking of a procedure call to the code to be
executed in response to the call.
Dynamic binding (also known as late binding) means that the code
associated with a given procedure call is not known until the time of
the call at run-time.
It is associated with polymorphism and inheritance.
11. Message passing
An object- oriented program consists of a set of objects that
communicate with each other.
Creating classes that define objects and their behavior
Creating objects from class definitions
Establishing communication among objects
12. Benefits of OOPs
Eliminate redundant code and extend the use of exiting
classes.
The principle of data hiding helps the programmer to build
secure programs
It is easy to partition the work in a project based on objects.
Object oriented systems can be easily upgraded from small
to large systems.
Software complexity can be easily managed.
13. Applications of OOPs
Real-time systems
Simulation and modeling
Object oriented databases
Hypertext, hypermedia and expertext
AI and expert systems
Neural networks and parallel programming
Decision support and office automation systems
CIM/CAM/CAD systems
14. Simple C++ program
#include< iostream.h >
#include< conio.h >
int main( )
{
cout<< “c++ is better than c”<<endl;
getch( );
return 0;
}