[Petal] TPJ article 0.1

William McKee william at knowmad.com
Wed Aug 20 10:58:36 BST 2003


Jean-Michel,

Yes, I have read it. I think your examples are good and like that you
give a behind-the-scenes look at how Petal operates (in fact, I'd rename
Advanced Petal to something like Inside Petal or The Code Behind Petal;
I think of advanced petal as more ways to use it, not how it works; the
modifiers section would be appropriate as an Advanced Petal topic).

I tried to put myself into the frame of mind of someone just coming
across the article. As such, I think you save some of the most
interesting info for the last (such as caching, modular architecture,
and the other bells and whistles mentioned in the conclusion) and don't
harp on the benefits of the TAL specs enough (you say it's a good idea
but don't really sell the reader on why a Perl programmer should be
implementing a spec from a Python project).

To help me recall why I became part of the project, I went back to
Revuen Lerner's "At the Forge" article[1]. It was this article that
convinced me TAL was the templating solution I'd been looking for since
1998. Unfortunately, noone had created a Perl implementation until you
came along.

If you read his introduction, you'll see that he does a very thorough
sales job before launching into code examples. I think the conclusion is
good but I think it bears including at the beginning of the article to
get folks interested in reading and, more importantly, trying the
examples.

I'm a bit confused about the canonicalizer section. I get the input
parser stuff but you say that there are two output canonicalizers. Your
example shows what a canonicalizer does with the input. However, the
output you show does not look like XHTML. If I understand correctly, the
canonicalizer builds the Perl sub that eventually generates the
page. Depending on the output canonicalizer chosen, the code gets built
and the data gets handled a bit differently. Is that accurate? Or does
the canonicalizer sit before the CodeGenerator?

Also in this section, you mention that there are three different ways to
write Petal syntax but never really explain why. In fact, I've never
really understood this.  Perhaps you can clarify your reasoning in the
article?

A question about modifiers. Would it be possible to create a modifier
library instead of a bunch of independent modules? According to the
article, the existing syntax names the modifier based on the filename.
What would need to change to allow Petal to install multiple modifiers
from a single module?

Other minor issues:
 - Digital Creations is now (according to Reuven's article) the Zope
   Corporation
 - client should be plural in 1st sentence of Hello World example
 - It should be I in last sentence of 1st para. of same ex?
 - I've noticed in the Petal docs that you are starting to use the tal
   namespace. Why do you revert to the petal namespace in the article?
   That may be confusing to users who want to install and use Petal.
 - In Adv Petal section, you refer to Fergal's Daly; although I suppose
   that Fergal possesses his last name, I'm guessing you meant to put
   that possessive after Daly.

My $0.02,
William


[1] <http://www.lerner.co.il/atf/atf_98>


-- 
Knowmad Services Inc.
http://www.knowmad.com


More information about the Petal mailing list