generic class for everything?

Rob Brown-Bayliss rob at zoism.org
Fri Mar 28 02:27:21 EST 2003


Hi, I have a problem that goes like this:

Lets say I have an object of a class car...

I have on paper a list of every thing that can possibly happen to an
object of class car (eg: run out of petrol, flat tire etc etc)

Lets say each item in the list can effect multiple parts of the car, for
example run out of petrol item can effect the fuel pump, the fuel gage,
the fuel injector, the speed, the electrical supply etc etc...

How could I go about designing an object for the list of possible
effects? 

I had though of a class that has:

unique identifier
name
description
stuff

where stuff is basically a large text field so item might be:

1234
"No Gas"
"The fule tank has run dry"
"fule(0) fule_light(on) power_out(-100%) electrical_out(-100%) lights(0)
"

and then parse  the stuff field modifying the parent class.

The only other option I can think of is having the class have avariable
for every single thing that can happen, but that seems to be a night
mare

Any thoughts?



-- 

*  Rob Brown-Bayliss
*  =================	
*      zoism.org







More information about the Python-list mailing list