Common data area

Dale Strickland-Clark dale at out-think.NOSPAMco.uk
Fri Oct 13 09:43:32 EDT 2000


How can a bunch of objects share a common data area without having to
pass a reference to it whenever a new instance is created?

To expand:

objA creates instance of objB which then creates instance of objC -
etc.

objB and ObjC both need read access to instance variables in objA

Currently, each class passes a 'self' reference to each instance it
creates but this is proving to be a bit messy.

Is there a better way I can make class instance objA available

I fully expect to be told that this isn't the object-oriented way to
do this. But even if I created a 'data' class to look after the data,
I'd still need to pass instances of it around the place, wouldn't I?

Pearls of wisdom always gratefully received.


Dale Strickland-Clark
Out-Think Ltd
Business Technology Consultants





More information about the Python-list mailing list