[Zope3-Users] Re: [Z3lab-checkins] r24502 - in z3lab/cpsskins/trunk: . browser/editor browser/skin elements/formats

Florent Guillaume fg at nuxeo.com
Thu Jun 30 13:21:58 EDT 2005


Jim Fulton  <jim at zope.com> wrote:
> Note that I prefer:
> 
>     c = IMenuItems(content, None)
>     if c is None:
>        return ''
> 
>     ...
> 
> > than testing directly for the provided interface, as it gives an  
> > opportunity for an adapter to do its job. It's probably slower  though, 
> > and maybe not a pattern generally used for marker interfaces.  Opinions ?
> 
> IMO, testing for an interface is sometimes preferable to using an adapter.
> Some people feel very strongly that you should never test for an interface
> -- I don't.
> 
> It seems silly to add an adapter just to avoid using a test
> (for religious reasons iow).
> 
> In particular, providing adapters to handle cases where an object
> doesn't provide some service and can't really be adapted to provide
> a service seems really silly to me.

I agree with that. My intent is more to provide "adaptation point" where
you are really allowing something to extend your framework
(aspect-oriented style).

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg at nuxeo.com


More information about the Zope3-users mailing list