What is all
the fuss about Objects &
Object Oriented
technology ?
Is it hype or it has a substantial existence ? Well , the truth is
that it combines both the facts.
Object – oriented technology
does , infact , provide many benefits to software
developers &
their products. However , historically
a lot of
hype has
surrounded this technology, causing confusion in both managers & programmers
alike. Many companies fell
victim to
this hardship (or took advantage
of it ) and claimed that their software products were
Object-Oriented when, in fact , they were not. These false
claims confused
customers, causing widespread misinformation
and mistrust
of Object -
Oriented technology.
However , inspite overuse &
misuse of
the term Object-Oriented the computer industry is now beginning
to overcome the hype. This article slashes through the hype &
explains the key concepts behind Object Oriented
programming , design , & development.
What is an
object?
An object
is a software
pool of
variables &
related methods
. Software objects
are used to
model real -world
objects you
find in everyday
life.
What are
messages ?
Software
objects interact
& communicate
with each other with the aid of messages.
What are
classes ?
A class is
a blueprint or prototype
that defines the variables and
the methods
common to all the objects
of a certain
kind.
What is
inheritance?
A
class inherits
state &
behavior from
its super class. Inheritance provides
a powerful
and natural
mechanism for
organizing and
structuring software
programmers.
OBJECT
& CLASSES
As the
name object –oriented implies
, objects are
key to understanding object-oriented
technology. Software object
has a state
& behavior. The
state is maintained
as data in its variables. Behavior
is implemented
as code in its object
methods.
The variables
and methods
are formally known as instance
variables and
instance methods to distinguish them from class variables
& class
methods.
OOP creates
software blueprints
‘ classes’ that specify all characteristics
possessed by the objects of that class. You can reuse
this code everytime you want
to create
a similar object
.
ENCAPSULATION
Packaging
an object’s
variables within
the protective
custody of its methods
is called
encapsulation . Typically ,
encapsulation is
used to hide
unimportant implementation details from
other objects. In software
programs ,implementation
of a class is insignificant, you
just need to
know what methods to invoke. Thus the implementation details
can change
at anytime
without affecting
other parts
of the program
.
BENEFITS OF
ENCAPSULATION
·
Modularity :
The source code
for an
object can
be written
& maintained
independently of
the source code
for other
objects.
·
Information hiding
: An
object has
a public interface
that other
objects can use to
communicate.
But the object can
maintain private information
& methods
that can
be changed at
anytime without
affecting other
objects depending on
it.
|