0% found this document useful (0 votes)
107 views

Object Oriented Concepts

The document discusses key concepts in object-oriented programming including objects, classes, abstraction, encapsulation, polymorphism, and inheritance. An object is an instance of a class that contains data fields and methods. A class acts as a blueprint for objects and defines their common properties and behaviors. Object-oriented programming organizes software as collections of discrete objects that incorporate both data and functions.

Uploaded by

diaeshantony
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
107 views

Object Oriented Concepts

The document discusses key concepts in object-oriented programming including objects, classes, abstraction, encapsulation, polymorphism, and inheritance. An object is an instance of a class that contains data fields and methods. A class acts as a blueprint for objects and defines their common properties and behaviors. Object-oriented programming organizes software as collections of discrete objects that incorporate both data and functions.

Uploaded by

diaeshantony
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

OBJECT ORIENTED CONCEPTS

Contents
1. OBJECT ORIENTED CONCEPTS ........................................................................................................... 1
OBJECT ......................................................................................................................................................... 1
CLASS ........................................................................................................................................................... 1
CLASS vs OBJECT ....................................................................................................................................... 1
WHAT IS OBJECT ORIENTED? ................................................................................................................. 2
OBJECT ORIENTED METHODOLOGY .................................................................................................... 2
ADVANTAGES OF OBJECT ORIENTED METHODOLOGY .................................................................. 3
OBJECT ORIENTED CONCEPTS ............................................................................................................... 4
DIFFERENCE BETWEEN ABSTRACTION AND ENCAPSULATION ................................................... 7

1. OBJECT ORIENTED CONCEPTS

OBJECT
 Objects are the physical and conceptual things that exist in the universe.
 In programming terms, an object is a self-contained component that contains properties and methods
needed to make a certain type of data useful.
 Object is an instance of a class.
CLASS
 A class is a blueprint or template or set of instructions to build a specific type of object.
 In programming terms, a class is a way to bind, data and functions into a single unit.
 A class is an abstraction that describes important properties of object.
CLASS vs OBJECT
Parameters CLASS OBJECT
Definition Class is mechanism of binding data Instance of class or variable of class.
members and associated methods in a
single unit.
Existence It is logical existence It is physical existence
Memory space is not allocated, when it Memory space is allocated, when it is
Memory Allocation
is created. created.
Declaration/definition Definition is created once. It is created many time as you require.

PREPARED BY: PRAMOD MATHEW JACOB 1


OBJECT ORIENTED CONCEPTS

WHAT IS OBJECT ORIENTED?


 Software is organised as a collection of discrete objects that incorporate both data structure and
behaviour.
 It includes identity, classification, polymorphism and inheritance.

IDENTITY
 Identity means that data is organized into discrete distinguishable entities called objects.
 Objects can be physical or conceptual.
 In real world object simply exist whereas in programming language each object has a unique
handle (unique identifier) by which it can be uniquely referenced.
 The handle can be implemented by address, array index or unique value of an attribute.

CLASSIFICATION
 It means that objects with same data structure (attribute) and behaviour (operations) are
grouped into a class.
 A class is an abstraction that describes important properties and ignores the rest.

POLYMORPHISM
 It means that the same operation (action or transformation that the object performs) may behave
differently on different classes.
 Specific implementation of an operation by a certain class is called a method.

INHERITANCE
 It is the sharing of attributes and operations among classes based on a hierarchical relationship.
 Subclasses can be formed from broadly defined class.
 Each subclass incorporates or inherit all the properties of its super class and add its own unique
properties.

OBJECT ORIENTED METHODOLOGY


 Object Oriented Methodology is a methodology for object oriented development and
a graphical notation for representing objects oriented concepts. This methodology is
termed as OMT. The methodology has the following stages:
1. Analysis
2. System design
3. Object design
4. Implementation

PREPARED BY: PRAMOD MATHEW JACOB 2


OBJECT ORIENTED CONCEPTS

ANALYSIS
 An analysis model is a concise, precise abstraction of what the desired system must
do, not how it will be done. It should not contain any implementation details. The
objects in the model should be application domain concepts and not the computer
implementation concepts.
SYSTEM DESIGN
 The designer makes high level decisions about the overall architecture. In system
design, the target system is organized as various subsystems based on both the analysis
structure and the proposed architecture.
OBJECT DESIGN
 The designer builds a design model based on the analysis model but containing
implementation details. The focus of object design is the data structures and algorithms
needed to implement each cycle.
 The Objects identified in the system design phase are designed. Here the
implementation of these objects is decided in the form of data structures required and
the interrelationships between the objects.
IMPLEMENTATION
 The object classes and relationships developed during object design are finally
translated into a particular object oriented programming language, database, or
hardware implementation.
 During implementation, it is important to follow good software engineering practice
so that the system can remain the traceability, flexibility and extensibility.
ADVANTAGES OF OBJECT ORIENTED METHODOLOGY
• The systems designed using OOM are closer to the real world as the real world functioning of the
system is directly mapped into the system designed using OOM. Because of this, it becomes easier to
produce and understand designs.
• The objects in the system are immune to requirement changes because of data hiding and encapsulation
features of object-orientation.
• OOM designs encourage more reusability. The classes once defined can easily be used by other
applications. This is achieved by defining classes and putting them into a library of classes where all
the classes are maintained for future use. Whenever a new class is needed the programmer first looks
into the library of classes and if it is available, it can be used as it is or with some modification. This
reduces the development cost & time and increases quality.
• Another way of reusability is provided by the inheritance feature of the object-orientation. The concept
of inheritance allows the programmer to use the existing classes in new applications i.e. by making
small additions to the existing classes can quickly create new classes.
• As the programmer has to spend less time and effort so he can utilize saved time (due to the reusability
feature of the OOM) in concentrating on other aspects of the system.
PREPARED BY: PRAMOD MATHEW JACOB 3
OBJECT ORIENTED CONCEPTS

OBJECT ORIENTED CONCEPTS


 ABSTRACTION
 Abstraction is "To represent the essential feature without representing the back ground details."
 Abstraction makes to focus on what the object does instead of how it does it.
 Abstraction provides you a generalized view of your classes or object by providing relevant
information.
 Abstraction is the process of hiding the working style of an object, and showing the information
of an object in understandable manner.
 ENCAPSULATION
 Wrapping up data member and method together into a single unit (i.e. Class) is called
Encapsulation.
 Encapsulation is like enclosing in a capsule. That is enclosing the related operations and data
related to an object into that object.
 Encapsulation means hiding the internal details of an object, i.e. how an object does something.
 Encapsulation prevents clients from seeing its inside view, where the behaviour of the
abstraction is implemented.
 Encapsulation is a technique used to protect the information in an object from the other object.
 POLYMORPHISM
 Polymorphism means one name many forms. It is the property of an object to behave differently
in different instances.
 One function behaves different forms.
 In other words, "Many forms of a single object is called Polymorphism."
 INHERITANCE

 Inheritance is the capability of one class to acquire properties and characteristics from another
class.
 The class whose properties are inherited by other class is called the Parent or Base or Super
class. And, the class which inherits properties of other class is called Child or Derived or Sub
class.
 Inheritance makes the code reusable. When we inherit an existing class, all its methods and fields
become available in the new class, hence code is reused.
 All members of a class except Private, are inherited
 Purpose of Inheritance

1. Code Reusability
2. Method Overriding (Hence, Runtime Polymorphism.)
3. Use of Virtual Keyword

PREPARED BY: PRAMOD MATHEW JACOB 4


OBJECT ORIENTED CONCEPTS

 The various types of Inheritance are listed below:

1. Single Inheritance
2. Multiple Inheritance
3. Hierarchical Inheritance
4. Multilevel Inheritance
5. Hybrid Inheritance (also known as Virtual Inheritance)

Single Inheritance

In this type of inheritance one derived class inherits from only one base class. It is the simplest form of
Inheritance.

Multiple Inheritance

In this type of inheritance a single derived class may inherit from two or more than two base classes.

Hierarchical Inheritance

In this type of inheritance, multiple derived classes inherits from a single base class.

PREPARED BY: PRAMOD MATHEW JACOB 5


OBJECT ORIENTED CONCEPTS

Multilevel Inheritance

In this type of inheritance the derived class inherits from a class, which in turn inherits from some other
class. The Super class for one, is sub class for the other.

Hybrid (Virtual) Inheritance

Hybrid Inheritance is combination of Hierarchical and Multilevel Inheritance.

PREPARED BY: PRAMOD MATHEW JACOB 6


OBJECT ORIENTED CONCEPTS

DIFFERENCE BETWEEN ABSTRACTION AND ENCAPSULATION

Abstraction Encapsulation
1. Abstraction solves the problem in the 1. Encapsulation solves the problem in the
design level. implementation level.

2. Abstraction is used for hiding the unwanted 2. Encapsulation means hiding the code and
data and giving relevant data. data into a single unit to protect the data from
outside world.

3. Abstraction lets you focus on what the 3. Encapsulation means hiding the internal
object does instead of how it does it details or mechanics of how an object does
something.

4. Abstraction- Outer layout, used in terms of 4. Encapsulation- Inner layout, used in terms
design. of implementation.
For Example:- For Example:-
Outer Look of a Mobile Phone, like it has a Inner Implementation detail of a Mobile
display screen and keypad buttons to dial a Phone, how keypad button and Display Screen
number. are connect with each other using circuits.

PREPARED BY: PRAMOD MATHEW JACOB 7

You might also like