[Zope] people structuring

Dieter Maurer dieter at handshake.de
Tue Sep 23 14:53:06 EDT 2003


Roman Bogoyev wrote at 2003-9-23 22:38 +0800:
 > ...
 > My thoughts were that people are spread across our organisiation in 
 > different groupings, and
 > may belong to more than one grouping.  Other 'objects' may contain these 
 > groups eg: a unit object
 > has one or more lecturers, as well as many students. A committee object 
 > has members etc. 
 > 
 > What I wanted was to find a way to keep to the object oriented spirit of 
 > zope/python and to
 > be able to express things like
 > 
 > funCommittee.members.joe.shoeSize 
 > 
 > and 
 > 
 > mathsClass.lecturers.joe.shoeSize

You could do that but you will need advanced (and potentially dangerous)
features (such as "__getattr__").

Only go this route when you are a proficient Python programmer.

 > where joe's shoe size is not a property of 'joe the lecturer' or 'joe 
 > the committee member' but of 'joe the person'.
 > And wouldn't it be nice if for some reason joe's feet swelled during 
 > lecturing and had a different size, and
 > mathsClass.lecturers.joe.shoeSize could return  the correct shoeSize in 
 > this context!

Do you really need that?

If so, expect your project to take 10 times as long as you had expected ;-)


Always start as simple as possible.
Do not go for nice features you do not really need.


Dieter



More information about the Zope mailing list