[TransWarp] Template parsing and XML/HTML processing design

Phillip J. Eby pje at telecommunity.com
Mon Jul 21 12:23:59 EDT 2003


At 05:56 PM 7/21/03 +0200, Roché Compaan wrote:

>This looks very promising. We were just testing if you still have all
>the answers ;-)

I try.  :)  At least, I try to be clear on where I'm headed with things.

There are an awful lot of things I find exciting about the 
model/view/pattern design, although I'm not sure those are the best terms 
for the ideas.  "pattern" isn't bad because it implies, "this block is used 
as a pattern for something".  Model and view aren't bad, but I'd almost 
prefer "subject" and "format", or something like that.  Model and view are 
so overloaded already, and clearer terminology would be helpful.  Really, 
I'd rather use "view" to refer to what are now called "locations" in 
peak.web, as that would correspond more closely to Zope 3's concept of 
"view".  I originally went with model and view because Woven does, and I 
thought at first that PWT's might be somewhat compatible with Woven 
templates.  However, the execution model is different enough that I don't 
think it's really practical to keep it the same.

I do want to get the terminology firmed up soon, though, or it'll be 
difficult to do any development with peak.web.  So, I'm open for 
suggestions on what sounds better.  Here are some ideas to get you started:

"model" words: subject, data, target, source, content

"view" words: format, renderer, control, component, widget, gadget, 
display, type

Ideally, I'd like both words to be nouns, or usable as an adjective, so 
that terminology for the associated objects is straightforward.  For 
example, I could talk about a "format component", or just a "widget".  I'd 
also like the "view" word to more strongly imply "visual 
component".  Brevity in the name is a virtue, from the typing 
perspective.  (Yes, I *am* lazy.  Why do you ask?)  But this needs to be 
balanced with descriptiveness, otherwise we'd end up with "what" and "how" 
replacing "model" and "view".  :)

Hmmm..  you know, if you used "show" as the XML namespace, you'd have:

<table show:what="tabulardata" show:how="list">

Interesting.  :)  'show:pattern' is a little odd, though.  Maybe <tr 
show:as="listItem"> or <tr show:this="listItem">?

I'd definitely want some feedback on the show: idea before I'd implement 
it, though, as I'm worried it might be too cutesy.  The other problem is 
that it doesn't translate well back to the implementation.  'addThis()' 
wouldn't be a very nice replacement for the current 'addPattern()'.  And I 
don't really want to talk about "how components" and "what components", as 
this could lead to some Who's-On-First-isms.  :)




More information about the PEAK mailing list