cherrypy/cheetah vs twisted/nevow

Carlos Ribeiro carribeiro at gmail.com
Sun Nov 7 13:00:46 EST 2004


On 7 Nov 2004 03:46:43 -0800, has <has.temp2 at virgin.net> wrote:
> Carlos Ribeiro <carribeiro at gmail.com> wrote in message news:<mailman.6014.1099765795.5135.python-list at python.org>...
> Carlos Ribeiro wrote:
> 
> > 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.
> 
> You're confusing presentation logic with business logic. In MVC, only
> *business* logic should go in the Model layer; presentation logic
> belongs elsewhere. The Model does *not* dictate how the User Interface
> layer(s) should receive input or present data. Think of the Model as a
> complete program within another program, containing all the smarts
> needed to do its job but providing no way for end-users to interact
> with that data. All it supplies is an API into which user-interface
> code can connect.

Well, there are lots of stuff that deserve commenting here. But I feel
that we aren't very far from each other (though my terminology
definitely needs improvement :-).

I agree that presentation logic (the term that I was missing) is
different from business logic. But I still think that the more you can
take the presentation logic *out* of the HTML template, the better.
That's my point when I talk about the reporting example.

I may be wrong, because I never programmed Macs, but I think that in
the original Apple MVC implementation, you had "resources" (that
stored the form definitions), and there was code to fill the form with
data ("presentation logic", right?). I have a lot of experience with
Delphi, that is also based on the same concept. In both cases (Apple
and Delphi), the resource is clearly separated from the code; they're
in separate files, and use different languages. This example shows one
of the problems with (many) templating systems; one has to write both
the 'resource' (the HTML Template) and the 'presentation logic' in the
same file.

Now, I'm reallly struggling to catch up with a lot of stuff, and I
don't know about HTMLTemplate, so I have to take your word for it; you
say it's good, and it separates the presentation logic from the
template, and that's what I am looking for. I'll check it now. Thanks
for the all the info.

-- 
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