[Zope-CMF] CMF, templates, and dtml

Dennis Allison allison@shasta.Stanford.EDU
Thu, 23 May 2002 08:14:29 -0700 (PDT)


On Thu, 23 May 2002, Chris Withers wrote:

> Dennis Allison wrote:
> > 
> > I did some experimentation a few weeks ago with CMF and ran into problems when I
> > mixed template and dtml pages.  At that time, CMF 1.2 seemed to be template based
> > with incomplete support for dtml.   Has this changed with 1.3?
> 
> No, DTML is being phased out ;-)
> 
> > And, BTW, is there a template equivalent for <dtml-tree>.  Ugly as the internals
> > may be, it's a very useful widget.
> 
> Yes, check the Examples folder in Any Zope 2.5.1 install...
> 
> > For CMF, what's the best practice design style?
> 
> that's a bit of a broad question ;-) care to refien a little?
> 

The [Zope] list recently had a question similiar to mine which differentiated
the template and dtml worlds by: 

	programming	 <==>	dtml
	designs		 <==>	templates

and included strong statements about the support of dtml.  Both have their strengths
and weaknesses so a system which mixes one and the other (and Python Scripts and 
External Methods, and ... ) seamlessly seems to be the best way to go. 

My concern with CMF is one of completeness.  I found the dtml-side of my
proto-prototype kept stumbling on tools which worked with templates one way and
either did not work or worked differently with dtml objects.  One of the reasons 
for using CMF is to leverage existing components; for this to work well, there 
has to be an environment which makes few assumptions about componenet elements
and their composition.

Two things concern me about the template system.  First is its performance, said
to be 2X or worse than "equivalent" dtml.  Surely the performance will improve,
but a factor of two or more is hard to get!  My other concern has to do with
functionality.  The template system is designed as a transformational system for
HTML--that is, its focus and concern is presentation.  The application at hand
is more concerned with logic and mechanism than with presentation.  The touted 
advange "works with wysiwyg tools" is of no interest--most of the pages and
material is programatically generated by our toolset.

As to the best practice query....  

After my initial experiment with CMF, I concluded that a site which mixed
templates and dtml was likely to have landmine problems--trip over the interface
and everything blows up. Given that, we chose to build our first system outside
the CMF framework and used dtml exclusively. 

I am now back designing the production system.  The system is a portal-style
system that could leverage some of the CMF components to advantage.  Once
completed, the system needs to have a lifetime of several years with little change
to the supporting code.  At the moment, it looks like the system will need to 
be written in python/dtml, but a mix of templates/python/dtml is also attractive.
The best practice is: what sub-systems and components will play with CMF?

-d