[TransWarp] Template parsing and XML/HTML processing design
Phillip J. Eby
pje at telecommunity.com
Mon Jul 21 09:19:14 EDT 2003
At 01:42 PM 7/21/03 +0200, Roché Compaan wrote:
>I really think this is a step backwards as far as templating
>technologies goes. Jean already mentioned the lack of a separate
>namespace for special attributes.
There is one, I just didn't use it in the example. See my last message.
>Additionally I think to enforce
>the separation of ui and code to death is extreme. Some logic is
>legitimate in templating, specifically simple expressions that serves
>only the presentation. Off course you can go overboard with ZPT's
>"python:" expressions but PEAK does not need to make that available on
>the context if it is strongly against python expressions in the
PWT is intended to support reusable components or "widgets". Embedding
code in a template is like writing code to draw every dialog box in a GUI
application pixel by pixel. If every time you need something complex, you
need to create a view component, you will enormously magnify your chances
of being able to reuse the component in future applications.
So, although PWT will start out "behind" other templating systems in
productivity, I expect its productivity level to be able to keep on
climbing as widgets are developed. I also know that for many applications
I'll want to be able to make app-specific custom widgets, as subclasses of
standard form widgets and such. This sort of thing is very hard to do well
with code embedded in the pages, regardless of whether it's Python or ZPT
or DTML that's in the pages.
>I often find that it is too expensive to create a class or python script
>when I build templates and simple "python:" expressions are very useful
If you're using a PWT, it'll be because you've bound it as a method in a
class, so the class is also the obvious place to put any such expressions,
perhaps as binding.Once() expressions. And the class you've bound it in is
probably a Location wrapper, so you can put all the view-specific code in
it you want without getting in the way of the domain logic.
More information about the PEAK