cherrypy/cheetah vs twisted/nevow

Carlos Ribeiro carribeiro at gmail.com
Sat Nov 6 13:29:53 EST 2004


On 5 Nov 2004 08:57:21 -0800, has <has.temp2 at virgin.net> wrote:
> Carlos Ribeiro <carribeiro at gmail.com> wrote in message:
> > In a way, you're right. The problem is that none of the templating
> > models that I know of completely separates the 'M' from the 'V'.
> 
> Plenty of templating systems allow Model-View separation. Not all
> *enforce* it, but this is a matter of philosophy [1], not an indicator
> that a template system is good or bad.
> 
> Some templating systems (e.g. Nevow.Renderer, PyMeld and HMTLTemplate)
> additionally separate presentation logic from markup via an approach
> that's strongly reminiscent of Apple-style MVC, where the View layer
> consists purely of GUI widget/template node instances and the
> Controller layer contains code for (1) manipulating these objects and
> (2) connecting to the Model layer.

I'm not sure if I understand your point, and it may be the case that
I'm really missing something. I think that, by its very definition,
templating systems (including variables, conditionals, loops, and
other control structures) *do* mix some aspects from the model into
the view. One may argue at which extent it's possible to keep both
apart -- at some point, there must be an interface -- so it may be a
matter of personal choice.

My current standing (after a long break from applications development,
which allowed me to re-enter with a fresh perspective, but also a
little 'rusty') is that the templating interface should be made
simpler, not more powerful, and that the model should take care of the
intermediation. For example, I *feel* that repetitive elements (like
lists and reports) shouldn't be modelled as programming loops inside a
template. I really don't have a solution for this yet. Albeit
confusing, XSLT is a step in the right direction, but it sometimes
feels like they're trying to fit a square peg into a round hole. Nevow
implement a very intriguing idea: it allows to derive the *structure*
from the template. I'm still looking, though.


-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com



More information about the Python-list mailing list