|
Posted by LaieTechie on 04/01/06 09:20
On Sat, 18 Mar 2006 12:34:01 +0000, elyob wrote:
> I've always been a procedual coder, and am looking to get into OO asap.
> Any hints and tips appreciated, I've not totally got my head around it
> yet.
In my first OOP course, the instructor told us that objects are black
boxes with attributes (properties) and actions (methods). Objects are
categorized into classes. All objects of the same class have the same
attributes (maybe different _values_, though) and the same actions.
A class may have a super class and / or some sub classes. Super classes
are more general ("abstract") and sub classes are more specific
("concrete"). This inheritance pattern is general described with an "is
a" phrase. A Malibu is a Car. A Car is a Vehicle.
Besides inheritance, you can aggregate objects together. This is
described with "has a". A Car has an Engine. When you tell a Car to
"turn on" it delegates that command to its Engine.
The whole point of using objects and classes is abstraction. You program
to a certain interface ("API") without having to worry about the specifics
of how it gets its job done.
HTH,
Laie Techie
Navigation:
[Reply to this message]
|