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
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...