 |
The Object-Oriented
Concept
|
An automobile
is a very good example of the Object-Oriented
Concept. As humans, it is our natural tendency to
think of an automobile as a single
"thing", and not as a large group of
several thousand small "things".
Thinking of the automobile as a single
"thing" helps us deal with the
overwhelming complexity of the whole machine. We
would say simple statements like; "Fill her
up." or "How fast are we going?"
or "I have a Blue car." ... and
everyone would understand how those statements
apply to our car. Using an automobile as an
example of an Object, the following program shows
an example of Object Oriented programming
BobsCar.Speed = 50
If BobsCar.Speed > CurrentRoad.SpeedLimit Then
PoliceCar.Mode = Chase
PoliceCar.Target = BobsCar
PoliceCar.Speed = BobsCar.Speed + 10
End If
As shown in the example, the overwhelming
complexity of Bob's car is reduced down to a
simple set of understandable terms.
|
In Object-Oriented terminology, collecting together a
large group of several thousand small "things"
into one single "thing" called an automobile is
called encapsulation. Once
encapsulated, the individual components within an object
are dedicated to that one object.
For example, The steering wheel in our car, will not turn
your home stereo's volume up or down.
Humans have been classifying everything in their world
into "Objects" since
the dawn of history because it is our natural tendency to
do so. By adapting our computer languages to
Object-Oriented Concepts, we tap into this natural human
tendency resulting in easy to use languages.
 |
The OOP in OOPic
|
Easy as...
RedLight
= ON |
 |
-Or-
|
|
RedLight
= OFF |
|
|
|
Any one who has programmed Embedded
Controllers knows how complex they can get. OOPic
eliminates this problem by encapsulating all the
components of Microchip's PIC16C74 PICmicroŽ, embedded
controller's hardware circuits into Objects.
During program development, these objects can be
named appropriately and then used with simplified
statements. |
By using the Object-Oriented Concept, OOPic
advances micro-controllers into the modern world of easy
to program objects.
|