[Zope3-dev] Re: Zope 3 without ZODB

Philipp von Weitershausen philipp at weitershausen.de
Mon Jan 22 08:03:30 EST 2007


Jim Fulton wrote:
>> Does grok have one of these?
> 
> I suspect so.

No, it doesn't. grok's "just" a package that

a) provides baseclasses for components

b) configuration "directives" that you use in your Python code

c) a configuration mechanism that, instead of parsing a configuration 
file like ZCML, inspects your code and takes the use of conventions and 
explicit "directives" as configuration input.

d) a set of custom publication objects to simplify security during traversal

Other than that, it's (at least currently) deployed into a nomal Zope 3 
instance (which is typically automated by zc.buildout). I don't think 
that needs to change, it would just be nice to be able to easily change 
the way the Zope 3 instance is deployed (zope.server, twisted.web2, 
modzope? cherrypy? ...)

>>> You would need to understand how the publisher framework worked and 
>>> plug in an alternate publication that traversed to non-ZODB objects.
>>
>> I touched on this with my reply to Philip, but surely the publication 
>> type should just be operating on objects that implement an interface?
>> It seems odd, at least to me, that I'd need to rewrite publications 
>> that know about things like http, ftp and webdav just because the 
>> object I want to publish come from a file system or relational 
>> database rather than a zodb...
> 
> The publisher knows nothing about the application. The publication 
> object is the object responsible for providing this integration. It is 
> not a very complicated interface to implement.  Depending on your needs, 
> you can likely subclass the existing piblication if you wish.

... which I've outlined how to do. The only problem (and here I agree 
with both of you) is that you'll have to subclass every single 
publication to plug in your custom behaviour. Providing an alternate 
root object is quite some simple alternation. It should be doable w/o 
reimplementing HTTP, Browser, XMLRPC, ... publications. grok currently 
has to do it and it sucks.

>>>> (I am willing to put the work in to make this happen if people give 
>>>> me some hints...)
>>> Other people have already made this happen. I don't know if any of 
>>> their code is public or if they have written up what they've done.
>>
>> This is a bit cryptic... are you saying there is an "alternative zope 
>> 3" that already has alternatives to zope.app.server.main or 
>> zope.app.twisted.main? If so, where are they to be found?
> 
> Alan Runyan and Sidnei Da Silva created one of the earliest Zope 3 
> applications using SQL Objects.  I don't remember the name of their 
> application or what it's status is.  Maybe they'll chime in or you can 
> ask them.  Launchpad is a Zope 3 application that doesn't use ZODB.  I 
> don't think that code is available.

Launchpad almost certainly has its own publications and its own main 
script. I see Sidnei had to do it for Snap as well. Eliminating that 
step would get Zope 3 (and grok) a lot further, I think.


-- 
http://worldcookery.com -- Professional Zope documentation and training
2nd edition of Web Component Development with Zope 3 is now shipping!


More information about the Zope3-dev mailing list