[Grok-dev] Re: Grok w/o ZODB

Philipp von Weitershausen philipp at weitershausen.de
Mon Apr 14 06:05:13 EDT 2008


Michael Haubenwallner wrote:
> Hi, i've just posted about my package that lets you run Grok without the 
> ZODB dependency.
> 
>   http://blog.d2m.at/2008/04/13/grok-without-zodb-wsgi-based/
> 
> I'd appreciate your feedback.

I couldn't find a way to comment on your blog, so here's my feedback:

* Currently you have a hard-coded root object that you import. It would 
be much nicer to make it pluggable as a utility, e.g.

   getUtility(IRootObject)

That way you'd have pluggable root storages instantly (a ZODB backend 
could register its root object as a utility upon opening the database, 
an SQLAlchemy backend could do the same based on user input, etc.)

* Why did you copy'n'paste zope.app.wsgi into your wsgi.py? I see no 
apparent reason for this (but maybe I'm blind). Also, I suggest turning 
over to zope.publisher.paste for the application factory, rather than 
zope.app.wsgi.

* I'm a bit scared by the in-line registrations in appsetup.py. If this 
is meant to be a pure-Zope3 package, they should be in ZCML. If it's for 
Grok, please use Grok directives. Either way, just doing them upon 
import will unleash wicked side-effects and basically makes your code 
untestable.


More information about the Grok-dev mailing list