On 5/6/09 8:50 PM, Martin Aspeli wrote:
> Shane Hathaway wrote:
>> Fernando Correa Neto wrote:
>>> Adding new template engines to BFG require you to know python while in
>>> GROK, it'd require you to grok grok first (which in would then
>>> introduce the developer to ZCA) which is definitely a Zope3 thing.
>> You hit on a point that I consider important. One of the interesting
>> things about ZCML (and hence BFG) is it's easy for any Python developer
>> to write their own directives. ZCML doesn't violate DRY, as I once
>> thought it did, because if you find yourself writing repetitive
>> directives, you can just create a custom directive in Python instead.
FTR, not that it matters now, but I just noticed that the premise of this
comparison is a little off kilter. Because the ZCML BFG "view" directive never
names a template (unlike Zope's browser:page), adding a new templating system
doesn't actually require writing a ZCML handler or a grokker. It just requires
the creation of a Python package that has quasi-familiar importable names like
"render_template_to_response", and so on. This comes at the expense of
requiring the view itself to know about the template name, and to decide which
templating system it wants to use. So it's a tradeoff.
>> Unfortunately, Grok obscures that simplicity. It seems much harder to
>> add new kinds of decorators than it is to add new kinds of ZCML directives.
> You're sure about that? I find it easier to write a new grokker (whether
> for a decorator or a more generic class grokker that looks for a base
> class) than a new ZCML directive (and I've done plenty of both).
> The grok approach is unfamiliar at first, for sure, and could do with
> more documentation. But then so could the writing of ZCML directives.
> Grok (and martian) do have some really nice abstractions, including good
> testing support.
>> The benefit of Grok's decorators is further diminished by the fact that
>> people who develop with Grok generally have to use ZCML anyway in order
>> to understand and extend the code Grok is built from.
> I guess it depends on how deep you go, I suppose, but this is definitely
> something that will hit a certain group of people.
In BFG, at least, every time I write a grokker I tend to write an equivalent
ZCML directive. The number of times I've had to do that so far has however
been one. ;-)
Repoze-dev mailing list