At 03:29 30/09/99 , Toby Dickenson wrote:
I had been working with Zope for six months before realising that acquisition did not work that way already, and I was relieved. Maybe I can persuade you that it would be a bad thing.....
Welcome to the club =). It took me 7, so you beat me.
With the rules as they are, an object can always rely on acquisition to source its containers first. Think of an object's containers as part of it's implementation, and the rules feel right.
Under the rules suggested by Martjin, acquisition would source attributes from an object's customers in preference to its containers (As Jay wrote, the place where you acquired it _to_, rather than the place where you acquired it _from_). I don't think you could use that kind of acquistion to build a robust application, because of the unbounded number of potential clients each object might encounter. An object could never really rely on what it might pick up through acquisition.
Let's make one thing clear. No wait, make that two: 1/ My name is spelled Martijn. But that's obscure Dutch, so no offence taken =). 2/ I never suggested that the way I thought acquisition worked should be implemented that way. That was someone else. I adjusted my view, and solved my problem another way (or will, because I haven't had the time to implement it yet). In other words, I reached yet another level of Zen.
If you need that kind of wild flexibility then IMO it is better to explicitly pass it from the client object as a parameter, rather than asking it to be acquired from the client.
In my case that would seriously mess up my code. I found another, im my opinion much more beautiful solution. Instead of trying to override a default inclusion, I now provide a framework for that inclusion, but leave out the default. I then pick up on those cases where a default was expected (old URLs), and redirect to another URL where the framework has been provided in the acquisition path. -- Martijn Pieters, Web Developer | Antraciet http://www.antraciet.nl | Tel: +31-35-7502100 Fax: +31-35-7502111 | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 ------------------------------------------