[Zope-dev] Running methods on Zope startup.

grahamd@dscpl.com.au grahamd@dscpl.com.au
Fri, 26 Apr 2002 20:44:03 -0600 (MDT)


On Apr 25 22:19, Myroslav Opyr <myroslav@zope.net.ua> wrote:
>
> Subject: Re: [Zope-dev] Running methods on Zope startup.
>
> Chris McDonough wrote:
> 
> >[snip]
> >
> There is product ZExternalNews which is working in background from Zope
> startup. You can take a look there. There are several Startup issues in
> the code.

Yes, this product is doing a similar thing to what I want to do. I
note though that it does:

  app=context._ProductContext__app

Ie., it breaks abstraction and accesses the private application context
which is available in the product context. Yes, it is possible, but it
is (is it) cheating. :-)

Is there any reason why the application context in the product context
just can't be public in the first place? It would make things easier
and doesn't seem that big a deal to change it. At least Zope could
provide a public method which gives access to it.

I also note that this product does what it needs direct from the product
initialize routine. As long as this product doesn't rely in anyway on
other products this would be okay, but if it did, it could be a problem
as threads created by the product might try to access another product
or even part of Zope which hadn't been initialised yet.

Anyway, I might just break the encapsulation in the same way for now, will
save a lot of work.

Thanks for the pointer to this package.

--
Graham Dumpleton (grahamd@dscpl.com.au)