[Zope] DTML vs ZTP

Jaroslav Lukesh lukesh at seznam.cz
Mon Dec 13 08:22:26 EST 2004


Dne pondělí, 13. prosince 2004 10:52 Tino Wildenhain napsal(a):
> > hmmm... As an example of keeping separation design from page logic could
> > be Plone? Do you try to redesign plone to your own absolutelly different
> > non-plonish design? Ha! It is very hard work, better to write whole
> > templates from the scratch.
>
> Well, this is because Plone is a very bad example of ZPT use.
> Still you can abuse ZPT - while you can somewhat cleanly use
> DTML - either case you need a sophisticated API to your application
> and dont write code in the presentation layer.
> If you are so far, you see its a bit more convient to use ZPT
> then to worry about where the h*** some variable got aquired.
>
> <dtml-in linklist>
> <a href="<dtml-var url>"> ... </a>
> </dtml-in>

It could be overriden by better use of names, so for example when I use SQL 
method:

<dtml-in linklist_ZSQL
	><a href="<dtml-var linklist_url>">...</a
></dtml-in>

S you know exactly what you have.

> (whats url? attribute? object? loop variable? request variable? Cookie?)
>
> <a tal:repeat="link here/linklist" tal:attributes="href link/url"> ...
> </a>
>
> Well, for me, the latter looks more understandable.

Yes, it is very good example, but it need to have good knowledge of ZPT, while 
dtml looks more like normal programming language. So dtml is more understable 
for eg. code auditors, your chief etc.

For imagine - I have huge book about DSP programming, and here are none 
concrete piece of code for any DSP chip, all sample codes are presented as 
simple  Basic programs, so you does not need to have knowledge of DSP 
assembler first.

-- 

                        Jaroslav Lukesh
  -----------------------------------------------------------
  This e-mail can not contain any viruses because I use Linux



More information about the Zope mailing list