[Grok-dev] Re: final sprint report - please review my branch!

Leonardo Rochael Almeida leorochael at gmail.com
Tue Apr 8 17:26:14 EDT 2008


On Tue, Apr 8, 2008 at 5:51 PM, Philipp von Weitershausen
<philipp at weitershausen.de> wrote:
> Martijn Faassen wrote:
>
> [...]
> > If we're concerned about subclassing, we can eventually expand Martian
> with the facility to recognize classes by interface as well:
> >
> > class MyClass(object):
> >   grok.implements(IGrokContext)
> >
> > I think this could then even be used to implement the base classes we have
> now (which I think are actually more readable):
> >
> > class Context(object):
> >   grok.implements(IGrokContext)
> >
> > I think such a thing is neat but of limited benefit, but it's something to
> thin about. Until we have such a thing, let's just stick with Context.
> >
>
>  I like the IGrokContext idea. It's just as simple as subclassing 'Context'
> (which we can still leave around). Sounds like a win-win solution.

Hey Martijn, this is the idea I was talking to you about on gtalk.

+1 from me as well.

Would it make any difference one way or the other if we used
"classProvides()" instead of "implements()" for this? Conceptually, I
think it makes more sense to declare that a class provides a certain
interface if we want to grok it. "implements()" declares things about
what the future instance provides instead of declaring things about
the class.

In this case we could even use the the component architecture itself
to look up the grokkers for a class (would that even make sense?).

Cheers, Leo


More information about the Grok-dev mailing list