On Fri, 20 Oct 2000 12:54:19 +0100, Chris Withers <[EMAIL PROTECTED]>

>>Consider the following passage in the documentation:

Noooooo - Context-based instance-space applications are a major source
of pain, bugs and security holes. They might be the one thing that
Zope does different (and therefore they need to be explained) but that
doesnt make them right.

>>     Suppose 'feedHippo.py' is a Python Method. How could you call the
>>     'Diet/feed' method on the 'LargAnimals/Hippo' object from your
>>     Python Method. Here's how::
>>       self.Zoo.Diet.LargeAnimals.hippo.feed()
>>     In other words you simply access the object using the same
>>     acquisition path as you would use if calling it from the
>>     web. Likewise in Perl you could say::
>>       $self.Zoo.Diet.LargAnimals.hippo->feed();
>>     Using methods from other methods is very similar to calling
>>     methods from the web. The semantics differ slightly but the same
>>     acquisition rules apply.

Thats fine until:

* someone adds an property named feed to an object at an intermediate
location in the containment heirarchy. This breaks the cron job that
calls self.Zoo.Diet.LargeAnimals.hippo.feed(), and all the hippos

* someone uses self.Zoo.Diet.buildings.visitor_reception.feed(), and
ends up filling the reception with hippo food. (This might even be
possible for someone who has no permissions on the reception object)

* someone wants to have a dinner party; feeding more than one animal
at once. But then he finds he has to switch to a different technique
because he cant call his dinner_party() method with more than one
context at the same time.

* someone uses
and ends up feeding paper to the hippo. (that could even be someone
who has no other permisions on that hippo object)

Ive now nearly finished converting all my newbie zope projects back to
a conventional O-O design. I have been bitten by all the problems
listed above. The feed method *should* *be* implemented in a ZooAnimal
base class.

Toby Dickenson

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to