[Grok-dev] Mystery of the Day

Martijn Faassen faassen at startifact.com
Thu Dec 18 09:43:32 EST 2008


Brandon Craig Rhodes wrote:
> Today's Mystery of the Day: why is the function
> 
>    zope.component.interface.provideInterface()
> 
> not named
> 
>    zope.component.interface.registerUtility()
> 
> instead?  The name "provideInterface" sounds like something that would
> operate upon a class and mark it as providing the interface - or, better
> yet, it sounds like a directive one would use when defining a class.

It isn't used to register just any utilities. It's used to register an 
*interface* as a utility so it can be looked up. Therefore it follows 
the pattern of 'provideAdapter' and 'provideUtility'.

Regards,

Martijn



More information about the Grok-dev mailing list