Re: OT - Kind of
Without trying to give a detailed lesson in object oriented design and programming (OOD/OOP), let me put it this way: an object in a program should model an object in the real world. LemmyM gave a good example with a class called "Ship". All ships have some basic things in common, so having a class called ship enforces that all types of ships have those things in common.
This leads to one of the most powerful aspects of OO: inheritance. Let's talk about a beagle. A beagle is a dog, which is a mammal, which is an animal, which is a living thing. So, we can define a beagle by starting from living things. A living thing has certain properties which we can assign to class cLivingThing. Class cAnimal derives from cLivingThing (which gives it all of the properties of cLivingThing). We then add to cAnimal the characteristics that distinguish an animal from other living things (plants, etc.) Class cMammal derives from cAnimal and adds the characteristics of a mammal (i.e. mother feeds baby milk). Class cDog derives from cMammal and finally cBeagle derives from cDog. Now, if we want to define a German sheppard, we only have to derive from cDog, everything else is already set up.
One of the big benefits to this is that what can be shared, is. For instance, if there is a bug in a routine that defines part of cLivingThing, we only have to fix it in cLivingThing, not in all of the things that are derived from cLivingThing. They all pick up the fix for free.
At any rate, that is a highly simplified account of what OO is. There is much more involved, but hopefully that gives you some idea of what you can do with it.
__________________
My SEIV Code: L++++ GdY $ Fr+++ C-- S* T? Sf Tcp A%% M+++ MpT RV Pw+ Fq Nd- RP+ G++ Au+ Mm++(--)
Ursoids of the Galaxy, unite!
|