[Zope-dev] Re: View component registration

Philipp von Weitershausen philipp at weitershausen.de
Thu Jun 19 09:37:20 EDT 2008


David Glick wrote:
> 
> On Jun 18, 2008, at 1:44 PM, Malthe Borch wrote:
> 
>> Martijn Faassen wrote:
>>> There's one major problem that I see. What's the backwards 
>>> compatibility story? I'm sure there are a lot of cases in lots of 
>>> code where people look up views with a getMultiAdapter, and if we 
>>> started registering views differently, wouldn't that code break? How 
>>> to we get from A to B?
>>
>> It deserves consideration, but I don't think code will be prone to 
>> break since we're merely providing more information to lookup a view 
>> component, not less.
> 
> Exactly.  The interface passed to getMultiAdapter or queryMultiAdapter 
> is a minimum requirement.  Making views provide IView won't stop them 
> from providing Interface, which is the default.

Well, true, view *lookup* for Interface will still work if we register 
views for a more specific interface. But if Zope's browser publication 
now starts looking up views with the more specific interface and there 
are still views around that haven't been registered for that but for 
Interface, we'll run into backward compatibility problems.

I suppose the browser publication would have to be smart about it and do 
a legacy lookup for Interface if it can't find a view for the specific one.

Either way, it's not *that* simple...


More information about the Zope-Dev mailing list