Always we get confused with the conceot of object orientation .So here I have tried to explain the basic object oriented concept as properly as possible.Thanx
result management system report for college project
Object orientation
1. Object orientation
an approach for non-procedural
languages
Submitted by
SHIVA SHANKAR SHANDILYA
Dept of CSE,CIT,KOKRAJHAR
E-mail-b12cs071@cit.ac.in
3. Introduction
Object orientation is a method of
classifying various objects into concept of
classes and objects.Object Oriented
Modelling,Object Oriented Languages are
all derivatives of Object Orientation.
eg.UML,C++,Java etc.
Object:-anything with its own attributes and
behaviour
4. FEATURES OF OBJECT ORIENTATION
•Information hiding(by unique identity)
•Encapsulation
•Separation of interface and information
•Messages
•Data Abstraction
•Classes
•Inheritance
Generilzation and Specialization
5. Information hiding
Features:
1.information is stored within the object
2.hidden from outside world
3.objects can manipulate information
Advantages:
•Simplifies our model by hiding information
•Acts as a barrier against changed
propagation(cannot be accessed directly to
change information)
6. Encapsulation
1. Data and behaviour are tightly coupled
within the object(i,e, objects comes with
both data and behaviour )
2. Both the information structure are
implementation hidden from outside
world
eg.phn no. is stored in digital format but
how it is converted to human readable
form is hidden
7. Separation of interface and
implemantation
•Change in implemantation does not effect
object interface
Messages
•Objects communicate with each other
through messages.
8. Data Abstraction
•Abstraction is way to cope with
complexity
•Principal:-Capture only those information
about an object that are relevant to current
perspective
Eg.a person may have many attributes but
if we talk about a student we can take
Attributes:-name,roll_no,year of study
Behaviour:-study,give exam,play sports
etc.
9. Classes
•In an Object Oriented model,the objects
that exibit same behaviour are put
together in an organisation called class
and we say that they belong to same
class.
Eg. Ram studies maths
Sohail studies chemistry
Anam studies physics
-Each one belongs to class student.
-Objects are instances of student class
10. Graphical Representation of class
(•
Class Name)
(Attributes)
(Operations or
behaviour)
Normal Form
(Class Name)
Suppressed Form
Person
Name
Age
gender
Eat
walk
Person
Suppressed Form
Normal Form
Eg.
11. Inheritance
•If a class B inherits from class A then it
contains all the
characteristics(information,structure and
behaviour)of class A.This is known a
inheritance.
•The parent class is known as base
class(A) and the child class is known as
derived class(B).
•Beside inherited characteristics derived
classes may have its own unique
characteristics.
13. Reuse With Inheritance
•Main purpose of inheritance is reuse
•Easily add new classes by inheriting from
existing classes
14. Generalization
•In a OO model some classes may have
common characteristics.
•We can extract these features in a new
class an inherit original class from this new
class this concept is known as
GENERALIZATION
STUDENT
PERSON
TEACHER
15. SPECIALISATION(RESTRICTION)
•Specialization means that derived class is
behaviourally incompatible with the base
class.
•Behaviourally incompatible means that
base class can’t always be replaced by
derived class.
Person
Age[0…100]
Set age(a)
Adult
Age[18…100]
Set age(a)
Age=a
If age<18
Error
Else
Age=a