Re: A summary of "Interfaces vs ZCA concepts"

Lennart Regebro <[email protected]>
Newsgroups gmane.comp.web.zope.devel
Message-ID <[email protected]>
On Fri, Dec 18, 2009 at 08:51, Brian Sutherland <[email protected]> wrote:
> I like things to fail noisily and loudly unconfigured and give good
> information about what's wrong.

+1

>  So my preferred implementation of a
> stub "utility" function on Interface is:
>
>    def utility(default=None):
>        """Lookup a utility for this interface.
>
>        A utility is a ${long explanation of utility concept}.
>
>        This method behaves like ${explanation of utility method contract}.
>        """
>        raise NotImplementedError("""No Utility lookup mechanism has been configured.
>            If you wish to use utility lookups on interfaces, please configure a
>            package that contains this mechanism. Packages known to
>            implement this are:
>                zope.component
>            """)
>
> I agree that this encodes in the zope.interface package concepts from
> zope.component.


I think that is stretching the "encoding concepts" a bit too far. Yes,
we make zope.interface aware that such a thing as utility-registries
exist, but say we don't implement it. I don't think that's a problem.
The error message also gives an example of an implementation. That's
probably not a problem either.

> I feel uncomfortable about that.

I don't. :-)

-- 
Lennart Regebro: http://regebro.wordpress.com/
Python 3 Porting: http://python-incompatibility.googlecode.com/
+33 661 58 14 64
_______________________________________________
Zope-Dev maillist  -  [email protected]
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.