Re: [Zope-dev] Re: View component registration

2008-06-19 Thread Jim Fulton


On Jun 19, 2008, at 9:37 AM, Philipp von Weitershausen wrote:


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...



I suggest:

- decide on and advertise the new interface

- continue to do look ups the way we do now

- update relevant zcml directives (view, page, resource. etc.) to use  
the new interface


- issue informative deprecation warnings when we register adapters  
providing Interface.


- Later, switch to looking up using the new interface.  Maybe make  
this an application option so that people can choose to use the new  
interface sooner.


Jim

--
Jim Fulton
Zope Corporation


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: View component registration

2008-06-19 Thread Christian Theune
On Thu, Jun 19, 2008 at 09:46:35AM -0400, Jim Fulton wrote:
 I suggest:

 - decide on and advertise the new interface

 - continue to do look ups the way we do now

 - update relevant zcml directives (view, page, resource. etc.) to use  
 the new interface

 - issue informative deprecation warnings when we register adapters  
 providing Interface.

 - Later, switch to looking up using the new interface.  Maybe make this 
 an application option so that people can choose to use the new interface 
 sooner.

+1

Would it be reasonable to also issue a warning if someone does a lookup for
Interface?

Christian

-- 
Christian Theune · [EMAIL PROTECTED]
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: View component registration

2008-06-19 Thread Jim Fulton


On Jun 19, 2008, at 10:46 AM, Christian Theune wrote:


On Thu, Jun 19, 2008 at 09:46:35AM -0400, Jim Fulton wrote:

I suggest:

- decide on and advertise the new interface

- continue to do look ups the way we do now

- update relevant zcml directives (view, page, resource. etc.) to use
the new interface

- issue informative deprecation warnings when we register adapters
providing Interface.

- Later, switch to looking up using the new interface.  Maybe make  
this
an application option so that people can choose to use the new  
interface

sooner.


+1

Would it be reasonable to also issue a warning if someone does a  
lookup for

Interface?



No, because clients have to look up using Interface as long as the  
component they need might be registered with it.


Jim

--
Jim Fulton
Zope Corporation


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: View component registration

2008-06-19 Thread Christian Theune
On Thu, Jun 19, 2008 at 10:50:00AM -0400, Jim Fulton wrote:
 Would it be reasonable to also issue a warning if someone does a  
 lookup for
 Interface?


 No, because clients have to look up using Interface as long as the  
 component they need might be registered with it.

Is that an argument for a grace period? I wondered about the case in general
or in the long run.

-- 
Christian Theune · [EMAIL PROTECTED]
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: View component registration

2008-06-19 Thread Jim Fulton


On Jun 19, 2008, at 10:53 AM, Christian Theune wrote:


On Thu, Jun 19, 2008 at 10:50:00AM -0400, Jim Fulton wrote:

Would it be reasonable to also issue a warning if someone does a
lookup for
Interface?



No, because clients have to look up using Interface as long as the
component they need might be registered with it.


Is that an argument for a grace period? I wondered about the case in  
general

or in the long run.


The grace period.

Jim

--
Jim Fulton
Zope Corporation


___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: View component registration

2008-06-18 Thread David Glick


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.


On a somewhat related matter, it would be great if the browser:page  
ZCML directive could be augmented to have a provides= attribute, so  
that even more specific categories of views can be marked.  E.g. for  
Malthe's Collage add-on for Plone, which does page compositing, we  
want to look up a named view on an object, but only if the view  
provides ICollageView.


David Glick
Project Associate
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
[EMAIL PROTECTED]
(206) 286-1235 x32

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup



___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )