An Introduction to the Object-Orientation
What is Object-Orientation
• A new technology based on objects and classes
• A way of thingking to organizing software as a collection of discrete objects that incorporate both data structure and behaviour
• An abstraction of the real world based on objects and their interactions with other objects
Three Characteristics of OO
Abstraction and Classification :.
o Focusing on essential, inherent aspects of an entity and ignoring its accidental.
o The idea of grouping software ideas into classes of things
Encapsulation and Information Hiding :
o Separating the external aspects of an object, which are accessible to other objects, from the internal implementation details of object, which are hidden from other objects
Polymorphism and Inheritance :
o Ability of abstractions to share properties by inheritance hierarchy.
Object and Classes
An object is a thing or concept. It can be a real-world thing or concept, or an abstraction of a thing or concept expressed as a software representation.
An object has state (attributes) and behavior (method)
“An object has state, behaviour and identity; the structure and behaviour of similar objects are defined by their common class .”
“The state of an object encompasses its (static) properties plus the
The first stage is called the Sensorimotor stage. It occupies the first two years of a child's life, from birth to 2 years old. It is called the Sensorimotor stage because in it children are occupied with sensing things and moving them. From these activities they learn what makes things happen, what the connections are between actions and their consequences. They learn to grasp and hold and what ...
current (dynamic) values of those properties.”
“The behaviour of an object encompasses how it acts and reacts, in
terms of state changes and message passing.”
“The identity of an object is that property which distinguishes it from
Individual objects, also called instances, have identity and are distinct things, and can be distinguished from other objects.
A class is a description of a collection of objects with common attributes and behavior.
In practice, the definition or specification of a class includes the
definitions of the attributes comprising the state, the methods
implementing the behavior, and how to handle creation and
destruction of an object.
The differences between class and object
• An object is a concrete entity that exists in space and time
A class is an abstraction, the essence of an object
• An object has specific values for its properties
A class describes these properties and the range of possible values
• A class is a type
An object is a variable of the type