[Community] zope.interface in PCL?

Alessandro Amici lists at bopen.it
Wed Mar 15 18:29:50 EET 2006


Kai,

Alle 12:16, mercoledì 15 marzo 2006, Kai Hänninen ha scritto:
> I can't be sure but it seems that the biggest problem you find with
> using the zope.interface package is the "zope" prefix there.

[...]

> The zope.interface is a light-weight component that can be used
> separately from other Zope 3 components. It does not imply *any* need
> to use other components and has nothing to do with web applications
> as such.
>
> In PCL's perspective zope.interface would simply be another
> (light-weight) dependency for a python package, like lxml or
> elementtree.
>
> To make it absolutely clear, PCL would not depend on Zope (the
> application server) but only on a python package called
> zope.interface.

ok, i didn't know zope.interface was a separate package. now that i 
checked my facts, at a wheight of 650kb without external dependencies 
zope.interface doesn't scare me as much as zope does ;)

just, please make sure to spell it prominently in the documentation, or 
this will become a FAQ.

> > I'm not so hot on having zope.interface be required for using PCL,
> > but I'm not going to fight it if that's what people want.
>
> For me the benefits of using interfaces are the following:
>
>   - Componentized design. The library is defined as a collection of
> components (providing interfaces) and any component can be replaced
> by another without affecting other parts.
>   - Documentation. Interfaces provide documentation for the software.
>   - More readable code

you don't need zope.interface for that.

the old system with interface classes and isinstance() (that you cite 
later in your email) was enough for all the abovementioned items.

sure, providedBy() is more elegant, but you can't use the generic 
arguments in favor of interfaces to prove your point on the choice of 
the zope interface implementation.

>   - Directly usable with Zope 3 Component Architecture.

IMHO, this is the real win in using zope.interface and it might be 
worth.

so this ends up being a matter of a trade-off and i admit i don't know 
the PCL internals enugh to comment, so i retract my -0.02 ;)

cheers,
alessandro

-- 
B-Open Solutions srl - http://www.bopen.it/




More information about the Community mailing list