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

Roché Compaan roche at upfrontsystems.co.za
Tue Jul 22 02:09:09 EDT 2003

* Phillip J. Eby <pje at telecommunity.com> [2003-07-21 22:41]:
> What follows is a write-up on the current consensus that Ty and I reached 
> after discussing the PWT terminology, and after reviewing the IRC channel 
> discussion on the subject.  If you find it unclear or awkward, or have any 
> other objections (or questions!), please let me know.
> =======
> DOMlet - A component (or class for such a component) that generates XML, 
> HTML, or text.  Currently, these are covered by various ITemplate* 
> interfaces; these will be renamed to IDOMlet*.
> PWT attribute syntax example:
> <table
>   xmlns:show="http://peak.telecommunity.com/peak.web.templates/"
>   show:data="tabulardata"
>   show:as="list"
> >
> <tr show:format="listItem">
>    <td class="oddrow" show:as="text">Odd row</td>
> </tr>
> <tr show:format="listItem">
>    <td class="evenrow" show:as="text">Even row</td>
> </tr>
> <tr>
>    <td class="oddrow">Sample data, as much as needed</td>
> </tr>
> <tr>
>    <td class="evenrow">for a realistic mockup.</td>
> </tr>
> </table>
> Explanation: peak.web templates convert an XML (or XHTML) template into 
> components called DOMlets.  By default, every element or text node of the 
> document is converted into a simple static DOMlet that outputs the original 
> content as-is.  However, by identifying a DOMlet class with the 'show:as' 
> attribute, you can cause the marked element to be converted to a DOMlet 
> that generates dynamic content.
> DOMlets need to know what data they're displaying, so the 'show:data' 
> attribute can be used to identify the data that will be supplied to all the 
> DOMlets inside the element where the 'show:data' attribute appears, 
> including that element itself.  The name or path supplied in 'show:data' is 
> *relative* to any enclosing 'show:data' settings, so in the following:
> <form show:data="myRecord">
> Enter your name: <input type="text" show:data="name" show:as="input.text">
> </form>
> The inner 'input.text' DOMlet will be applied to "myRecord/name".  This 
> example also demonstrates that show:data and show:as do not have to appear 
> on the same document elements.

I don't like "show:as". I will constantly have to remind myself that
this denotes a DOMlet. Just now I had to look at the previous mail
where the model-view-pattern syntax was used to figure out what it
corresponds to. Why not just use "show:dom" or even "show:view", and
there's your noun. I like "show:data" and "show:format" very much - one
understands that intuitively. Data, view, format makes a nice trio.
Whats wrong with "view" again? "View" can be quite general and less
helpful than one wants but maybe the context we use it in saves it here.

The concept of DOMlet is fine but I must still get used to the name. If
I don't by the end of the day I'll let you know ;-)

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

More information about the PEAK mailing list