[TransWarp] PROPOSAL: New peak.web.template terminology/explanation

Roché Compaan roche at upfrontsystems.co.za
Tue Jul 22 15:21:30 EDT 2003


* Phillip J. Eby <pje at telecommunity.com> [2003-07-22 19:10]:
> At 12:37 PM 7/22/03 -0400, Ty Sarna wrote:
> >Oops, sent the last message privately -- I proposed "layout" as a
> >possible replacement for "as". Works well for plural data, less well for
> >singular.
> >
> >But I had another thought...  "view" is out, and there is resistance to
> >"as"....  but what if we combine them into "view-as"?  It's intuitively
> >familiar from GUIs, especially file managers, and it seems to partially
> >mitigate the issue with "view" being overloaded. Though now that I think
> >of it in context, "show:view-as" sounds very clunky. Hmm... and for that
> >matter, so is "show:view".
> >
> >I guess at this point "as" is my first choice, and "widget" my runner-up
> >if people feel strongly that it must be a noun.
> 
> I might not be opposed to view-as, we'd just need to drop 'show' as the 
> example prefix.  Data and format work okay with any prefix.  So then we'd 
> have:
> 
> <table pwt:data="mydata" pwt:view-as="list">
> <tr pwt:format-of="listItem">

What about

    <table pwt:data="mydata" pwt:display="list">
    <tr pwt:format="listItem">

I missed "display" when I first scanned 'view' words and I really like it.
It is intuitive and I can't think of any objections against using it. It
sort of combines "view-as", it is quite distinct from the other two
terms.

> I think I like "layout" better than view-as, however, even though it seems 
> a little odd for certain uses; e.g. layout="translate"!  Also, ironically 
> it means the opposite of what it says.  Really, the HTML is what is really 
> controlling the layout, the DOMlet is just merging data and the template.

Then why is it called DOMlet? I don't fully understand what a DOMlet
does so maybe you can explain some more. The only thing I think of when
I see DOMlet is the canonical DOM.

> Some other thoughts: 'xform' (like transform, but shorter; OTOH it might be 
> confused with XForms technology), 'adapter', 'lens', 'render-as', 
> 'style-as' (style is a common HTML attribute).
> 
> 'adapter' is somewhat interesting, since it sounds like something our 
> hypothetical deep-frozen developer might get.

But it will confuse all of us that use zope and peak adapters.

> OTOH, if we want to go COBOL 
> all the way, then 'data', 'use-format', and 'define-format' might be the 
> best bets.  A little more modern would be 'data', 'format-as' and 
> 'format-of', but this may be more difficult for non-native English speakers 
> to distinguish.
> 
> *Sigh*.  All of these are pretty verbose.  It's somewhat ironic, as you'd 
> think PWT would involve less overall typing than a ZPT, but for certain 
> common idioms ZPT and suchlike scripting systems are more compact, because 
> they can devote an attribute to a particular use.  We have to specify both 
> the data and DOMlet in order to do anything.  There's less *typing* in a 
> PWT as a whole, but more of the typing that you *do* have to do, is 
> overhead (i.e. not relevant).  Thus, it's perceived differently.
> 
> Okay, here's a radical idea.  Suppose we ditched the separate attributes, 
> and did *this*:
> 
> <table pwt:domlet="list:mydata">
> <tr pwt:define="listItem">

Are you sure there are no use cases where 'data' and 'display'
definitions can sensibly defined on different html tags.

Is
    <table pwt:data="mydata">
    <tr pwt:display="list">
    ...
    <tr pwt:display="text">

not very likely? I can't think of any examples now, just thought one
should consider it.

The syntax is also very terse, it compresses more than the brain can handle
with one look.

-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za



More information about the PEAK mailing list