The first or the third approach.  Definitely not the second.

The first approach basically exposes your model to your view, letting
the controller mediate the process.  It's my favorite approach, but I
like to write "smart models" and "dumb controllers", using database
views and model methods and so forth, to make it happen.  Securing
against inappropriate model manipulation is also not a real concern in
my apps, as I'm the sole developer, modulo a few tweaks here and there
by other devs.  This is the preferred model of Zope's TAL and Kid.

The second approach entirely defeats the purpose of MVC and should be
avoided.

The third approach tends to make your views still somewhat dependent on
the controller handing it the right data, since they're no longer able
to navigate the object graph themselves for complex view logic (like,
say, "apply filter to show only tickets owned by Joe and closed less
than three days ago") and must rely on the controller to implement it.
Depending on your personal philosophy or requirements (like
developer-friendliness), this might actually be what you want.  This
approach would seem to be encouraged with Django (I don't actually
know) and it's the only approach you can use at all with Clearsilver.

There's also a hybrid approach of dynamically creating "model-ish"
objects that exist only as proxies to your underlying objects.  This
can be a great place to do security, but it's usually hard to get it
right unless you make the RDBMS actually enforce it for you.  They do
have the advantage of being a lot more cacheable, which is usually good
for scaling.  I don't really recommend this for starting out though.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss
-~----------~----~----~----~------~----~------~--~---

Reply via email to