[Grok-dev] Re: grok.Interface?

Philipp von Weitershausen philipp at weitershausen.de
Thu Jun 26 10:58:49 EDT 2008

Martijn Faassen wrote:
> Brandon Craig Rhodes wrote:
>> Kevin Teague <kevin at bud.ca> writes:
>>> Has making zope.interface.Interface available as grok.Interface been
>>> considered?
> [snip]
>> But for things like "Interface" that are not directives but are simply
>> normal objects of various sorts, we might not want to start down the
>> path of providing them through "grok", since otherwise there's no end to
>> the number of things it would have to include.
> That's a reasonable rule, though I'd like to make an exception for 
> events. All rules like this tend to have their exceptions. :)
> Events can come from every which place, and it'd nice to just be able to 
> say grok.IObjectModified and not having to worry anymore which 
> zope.whatever package that particular event came from. In fact, I'd like 
> to add the IBeforeTraverse event to the grok namespace too, as it's 
> quite frequently used.

To avoid polluting the 'grok' namespace too much, perhaps we should put 
this collection of useful imports in 'grok.event'?

>> People so far, I note, have responded to you by talking about Interface
>> as the target of adaptation; do Grok people ever creates Interfaces of
>> their own and need "Interface" for that?
> I'm not sure I understand the question, but I define interfaces as a 
> form of documentation in most of the (intended-to-be) reusable code I 
> write. Also of course whenever you need to define a schema you need to 
> use Interface.

Yup. In addition to that, interfaces (and schemas) are useful not only 
for adaption, but for form generation, security declarations (ok, not in 
Grok... yet), indexing, etc.

More information about the Grok-dev mailing list