[Zope-Moz] Templates anyone?

Martijn Pieters mj@digicool.com
Sun, 27 Feb 2000 10:45:11 -0500


From: Shalabh Chaturvedi [mailto:shalabh@pspl.co.in]
> From: Martijn Pieters
> >
> > But you can no longer make any changes to the component source then,
> > unless you hunt down all the DTML methods it is used in and re-parse
> > those as well! Not very elegant I'd say.
> 
> IMHO, I disagree.
> Isn't what you say also the case with:
>   o  All Zope products
>   o  Any new tags (like calendar) that may be defined
>   o  Any DTML Method that has a number of <dtml-var xVar> and
>       expects all the xVars to be defined when it is called.

No. I can change a product and restart the Zope server. All instances of
the Product are then updated with the new functionality. The same goes
for parsed dtml-tags, like the calender tag. I am not sure what you mean
with the DTML Method.

> 
> > No, the component should be any callable Zope object. That 
> way you keep
> > it OO and reusable.
> 
> It is reusable, once it is defined. OO and Patterns are not 
> enemies. They mix
> well, in fact.
> 
> Having a single component_contents doesn't provide anything 
> new. Doing what it
> does has always been possible: the template/component might 
> just as well be a
> DTMLMethod called myTemplate and used as:
> 
> <dtml-let componentContents=" foo ">
>    <dtml-var myTemplate>
> </dtml-let>
> 
> Instead if we have two levels of evaluation, we get more 
> reusability, not less.

Who said it was new technology? It is a new paradigm, one we could work
on still. But I don't think we should add a new syntax and a limitation
to one way of creating a component. OO would let you use different
classes of objects for the component tag, your special syntax proposal
would not.

What the component tag could add, for example, is the postponing of
rendering it until it is used in the template. That way you can use more
DTML in the component tag contents, and have it render differntly in
different places in the component. The let tag construction you
described will not let you do that.

-- 
Martijn Pieters, Software Engineer 
| Digital Creations http://www.digicool.com 
| Creators of Zope      http://www.zope.org 
| mailto:mj@digicool.com       ICQ: 4532236
| PGP:
http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149 
-------------------------------------------