[Grok-dev] Re: registering a factory as a (global) utility

Martijn Faassen faassen at startifact.com
Fri Apr 27 13:31:42 EDT 2007


Martijn Faassen wrote:
> Hey,
> 
> Martijn Faassen wrote:
> 
>> It's still useful to have this for global utilities, though. I propose 
>> the following alternate directive to do this:
>>
>> grok.global_utility_object(Item, provides=IMyFactory)
>>
>> I chose a separate directive because making global_utility take either 
>> a factory or an instance requires all kinds of extra checks and is not 
>> as readable as having a separate directive. I'm not sure I'm happy 
>> about the name though.
> 
> Thinking about this some more, I've changed my mind, and I think we 
> should do:
> 
> grok.global_utility(Item, provides=IMyFactory, factory=True)
> 
> This will allow us to define a factory=True argument for local 
> utilities. The effect in both cases will be that the first argument 
> won't be called but registered directly.

Since there appear to be no objections, I will add this improvement.

Regards,

Martijn



More information about the Grok-dev mailing list