[Grok-dev] model schema declaration
janwijbrand at gmail.com
Mon Jul 16 03:24:01 EDT 2007
On 7/15/07, Leonardo Rochael Almeida <leorochael at gmail.com> wrote:
> If a module contains a model, and an interface with the same name as
> the model but with an "I" before the name, this would automatically
> mean the model implements the interface.
As Philipp said, too much magic. And it magic that might not be very
useful either: If you have just one implementation of an interface,
you can already just skip writing interfaces altogether.
But when you do have more than one implementation for an interface you
loose the "advantage" of the magic anyway, because the class names can
not be used anymore for deducing the interfaces.
And there's also the situation where one class implements a
combination of interfaces; there's no "gain" there either.
Personally, I find myself using Grok's automagic naming conventions
only very occasionaly. I almost always explicitly use grok.context,
grok.name, grok.template, grok.implements, etc. Esp. when you
application starts to grow, and more and more related classes show up
in your modules, I find the explicitness very helpful and readable.
More information about the Grok-dev