[Zope3-dev] Re: Creating initial services
Guido van Rossum
guido@python.org
Wed, 11 Dec 2002 14:38:16 -0500
[me]
> > I'd like to write the code for setting up initial services.
[Jim]
> OK
> > I found a spot in SiteDefinition.py where a new site is
> > initialized (_initDB()), and I think I could add some code to
> > create an event service and an object hub.
I've done this now, in a hardcoded way. When you start with an empty
Data.fs, an Events service and an ObjectHub service are created and
activated in the root folder. It feels like an improvement already.
And it should be easy to add other services as the need arises.
> I'm not very happy with the StartUp package. In part, this is
> because I want to separate system setup from process setup. This is
> important when you want to access a system from Python code without
> running any servers. I've started to do this. For example, a while
> ago, I created Zope.App._app to collect a number of facilities for
> configuring Zope, opening and setting up the database, and getting
> to root objects and debugging facilities from a Python prompt. These
> are exposed in Zope.App.config and Zope.App.Application.
>
> I'd like additional root object setup to be put in Zope.App._app.database
> and I'd like Zope.App.Startup.SiteDefinition.SiteDefinition._initDB
> to be refactored to use Zope.App._app.database.
OK, will do.
> > But it occurs to me that we should probably do this from a
> > suitable zcml file.
>
> I think that would be a good todo. I don't think we need to do this
> right away though.
Sure. I also hear that the SiteDefinition should return a list of
directives instead of executing directives as it goes -- would that be
a good exercise?
--Guido van Rossum (home page: http://www.python.org/~guido/)