[Zope-Moz] Templates anyone?
Shalabh Chaturvedi
shalabh@pspl.co.in
Sun, 27 Feb 2000 20:45:21 +0530
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, 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.
Shalabh