On Jun 11, 4:10 pm, Karlo Lozovina <[EMAIL PROTECTED]> wrote:
> What's the practical difference between controller based approach and
> views based one? Eg. Django views, and controllers in Pylons? It
> doesn't seem that much different, so why not make all controller
> actions regular functions, instead of class methods? What's the gain
> in this controller approach, if any? :)
>
> Thanks...

I differ a bit from the opinions above.  I like to think of a web
request as asking "show me something."  Therefore, IMO, it makes sense
to map a web request to a "view".  The view (a Python class) then
knows how to use actions (a Python class) to "do something", the
actions know how to use the model to get work done.  The view then
renders a response in an appropriate format (HTML, JSON, etc.) using
any helpers necessary (i.e. "templates").  The view does not have to
render using a template though.

I had a diagram of this at one point, but can't get the darn thing to
open right now.  If anyone is interested in seeing a diagram let me
know and I will try to get it working and post one.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to