[Zope3-dev] should the view lookup machinery call getAdapter?

Casey Duncan casey@zope.com
Tue, 02 Apr 2002 09:19:41 -0700


In light of the fact that we do not have transitive adapters yet (and I 
am not yet motivated to implement them 8^), I am going to punt on this 
issue and simply make attribute memento storage the default for all 
objects. I have the distinct feeling that Jim will yell YAGNI on this 
anyway. I fear that it will, in the end, weave a tangled mess of implied 
interfaces that no one will be able to figure out.

I'm also not going to bother creating an ISecurityManageable/Storable 
interface right now. Its an interface that would not concern Zope in the 
least anyway. The less marker interfaces, the better, for now.

Objects will need to make no assertion that they implement 
IAttributeMementoStorable. Then you can use your example below to easily 
override it. Magic or no, it is pretty explicit in that it is at least 
declared as the default adapter. I think that will be what ppl want 99% 
of the time anyhow.

An if you want to explicitly declare that your class implements 
IAttributeMementoStorable, so be it.

-Casey

R. David Murray wrote:
> On Mon, 1 Apr 2002, Casey Duncan wrote:
> 
>>R. David Murray wrote:
>> > One question:  how would the following hypothetical (but probably
>> > essential) adapter play into your scheme?
>> >
>> > <adapter
>> > 	factory="Zope.App.OFS.Memento.ObjectHubMementoBag."
>> > 	provides="Zope.App.OFS.Memento.IMementoBag."
>> > 	/>
>>
[snip]
 >

> Better, I think, would be for there to be a default way for security
> settings to get stored for objects that haven't bothered to declare
> how they want them stored; sort of a stronger version of your "Just
> store my damn security settings for me".  You could think of it as
> the security system saying "just store this damn data for me", even
> if the object isn't listening <grin>.
> 
> 	<adapter
> 		factory="Zope.ComponentArchitecture.NullAdapter."
> 		provides="Zope.App.Security.ISecurityBag."
> 		for="Zope.App.OFS.Memento.IMementoBag." />
> 
> Like I said, I'm back to thinking transitive adapters are a better
> solution to these issues.
> 
> --RDM