Alexander Staubo wrote:
Hmm, seems a pretty important feature, does anyone know if this sort of functionality is on the drawing board for the Zope interface?
Post it to the Collector (http://www.zope.org/Collector) if you think it's important. I agree; but this prompt the question: "Yes, but how?" Should you be able to define properties that can accept only one type of object? Several types? Any type of object? Another aspect is interdependencies -- you might want to introduce deletion constraint on which objects may be deleted if they're referenced, and so on.
As far as object constraints are concerned, I was actually thinking of a constraint by metatype, so that if you have several types of objects you want to reference from a single attribute pointer, they should probably inherit from a common base class. Interdependencies -- well, frankly I hadn't given that much thought. you would probably have to deal with it on a case by case basis. I think it may be too application dependent, although a deletion mechanism that replaces references to a deleted object with references to another object of the same type might be handy. Example: someone in the sales dept. is fired, so he is deleted from the system. when being deleted, the system could ask which other instance of 'salesman' should replace the references to the deleted instance. This is of course, not a very good example, as this would not only assign the fired salesman's customers to someone, but in all likelihood also add all of the deleted salesman's prior sales towards the second guys quotas. So there may be no way around custom deletion methods in complex applications. If anyone else agrees with Alexander and myself that being able to assign 'pointers to objects' as attributes ( as opposed to actually instantiating an object as an attribute) would be a good addition to the Zope interface, let me know, and I'll incorporate your suggestions before I post this to the Collector. OTOH, if you disagree, and don't want this cluttering up the Collector, let me know that too. Michael Bernstein.