Intro - To - Object - Orientation
Intro - To - Object - Orientation
Intro - To - Object - Orientation
Overview
• What is object orientation?
• Object-Oriented Origins
• Object-Oriented Concepts
CSE 2031 – OOSD 3
What is an object?
• Objects are the elements through which we perceive
the world around us
• Every thing around you can be termed as an object
(Example: desk, student, lecturer, dog, car)
• Real-world objects share two characteristics: They
all have state and behavior.
▫ Example: Dogs have state (name, color, breed, hungry)
and behavior (barking, fetching, wagging tail)
• Identifying the state and behavior for real-world
objects is a great way to begin thinking in terms of
object-oriented programming.
CSE 2031 – OOSD 5
Classwork
• List out the state and behaviour of a student
object.
CSE 2031 – OOSD 8
Object-Oriented Programming
• OOP is a method of implementation in which
programs are organized as cooperative
collection of objects, each of which represent
an instance of some class, and whose classes
are all members of a hierarchy of classes
united via inheritance relationships. [Booch]
• Example of OOP languages: Simula-67,
Smalltalk, C++, Java, PHP
CSE 2031 – OOSD 9
Object-Oriented Analysis
• OOA is a method of analysis that examines
requirements from the perspective of the
classes and objects found in the vocabulary of
the problem domain. [Booch]
CSE 2031 – OOSD 10
Object-Oriented Design
• OOD is a method of design that encompasses
the process of object-oriented decomposition
and a notation for depicting both logical
(class and object structure) and physical
(process and data flow) models of a system as
well as static and dynamic aspects of a
system. [Booch]
CSE 2031 – OOSD 11
A hierarchy of Bicycles
CSE 2031 – OOSD 27
Questions
1. Real-world objects contain ___ and ___.
2. A software object's state is stored in ___.
3. A software object's behavior is exposed through ___.
4. Hiding internal data from the outside world, and accessing
it only through publicly exposed methods is known as data
___.
5. ___is the representation of all the essential features of an
object, which means its possible states and behaviours.
6. When we use inheritance, we have classes at the top of the
hierarchy that are known as ___ and classes at the bottom
of the hierarchy (or those which inherit from some other
class) known as ___
7. The code to be executed by an object when it is sent a
message is known variously as a ___ , or a ___ .