[Zope3-dev] Re: Are pagelets content providers?

Thomas Lotze thomas at thomas-lotze.de
Thu Oct 4 14:32:31 EDT 2007


Roger Ineichen wrote:

> What do you recommend to do? I'm open to improve it but how can we reflect
> the different adaption concepts like we have with the different __init__
> used by IPagelet and IContentProvider.

It should be easy to do by using a factory function which is registered as
the multiadapter to IContentProvider. It would take the context, request,
and view as arguments, instantiate a pagelet passing only the context and
request as constructor parameters, and finally set its view attribute.

> I agree that __init__ is not a part of the interface. But I also think it
> should be a part of a (probably another) interface since this is required
> by a specific lookup pattern.

No. __init__ is not part of any interface. It is a matter of
implementation. IMO, if there are to be different ways to construct
instances providing the same interface, there ought to be different
factories producing such instances depending on context and chosen
implementation (class). A class itself is just another one of those
factories.

> Ok, I see your idea

:o)

-- 
Thomas





More information about the Zope3-dev mailing list