[Grok-dev] Question about initialing grok.GlobalUtility with data from application containers

rmoskal rmoskal at mostmedia.com
Sun Sep 14 19:35:11 EDT 2008

I have a question about pulling data from the application containers into a
GlobalUtility.  My use case is  this. I have a container full of articles,
each article has a placement which governs where and when it is published. 
I want to enforce certain business rules which pertain to and require
knowledge about all the placements in the system.

The business rules will be enforced by invariant constraints on the
placement class.  I figured a GlobalUtility would be the way to go, since I
don't want to persist the network of relationships to the ZODB.  At some
point the GlobalUtility, call it the ProductionCalendar, needs to traverse
all the articles/placements in the system.

The only way I can think to get this done is to actually pass the
articles/placements context  to the method where I test the validity of a
placement.  I can set a flag to indicate if the GlobalUtility has been
intialized, and load up the existing data exactly once.  This seems
unsatisfying.  Can anyone suggest a more elegant way?

It seems like a common use case.


Robert Moskal
Brooklyn, USA
View this message in context: http://www.nabble.com/Question-about-initialing-grok.GlobalUtility-with-data-from-application-containers-tp19485498p19485498.html
Sent from the Grok mailing list archive at Nabble.com.

More information about the Grok-dev mailing list