[Zope-dev] Anyone want to do Google Summer of code mentoring for PSF?

Martijn Faassen faassen at startifact.com
Mon Mar 21 09:35:38 EDT 2011


On 03/20/2011 04:29 PM, Jim Fulton wrote:
> On Sun, Mar 20, 2011 at 11:00 AM, Hanno Schlichting<hanno at hannosch.eu>  wrote:
[snip]
>> I think you cannot avoid this, if you want to support an explicit
>> configuration phase. Otherwise the first import of a module could
>> occur at any point at runtime and have a configuration side-effect
>> like registering a new view. Personally I find the venusian approach
>> pretty simple and explicit enough.
>
> I disagree.  First, the notion that you'd import at run time is pretty odd,
> unless you count start-up in "runtime".

You might have a module that you don't import at all, but does define 
components you want to be wired up. How is this module going to be 
registered? You could import it after all in some module you *know* is 
going to be imported (which one?). It seems rather easy to make a 
mistake here and wonder why things don't get configured. Plus you're 
importing stuff that you then don't use.

> Second, well, really, I'm not ready to give up on a straightforward
> definition of wiring that doesn't rely on module scanning.

You could do the wiring using class decorator side effects, but the 
module will still need to be touched to get the decorators to kick in.

Regards,

Martijn



More information about the Zope-Dev mailing list