On 14/12/2010 00:58, Gerry Reno wrote:
What I really don't like right off is that Pyramid is contorting the MVC
model
That specific pattern, I'm afraid, is a little antiquated nowadays,
particularly when it comes to web apps...
The VIEW is the bits that stream out of the webserver back to the users
browser.
Yep, and in Pyramid I guess this would be the template renderer, which
is usually a decorator on the view function or class. The view's job is
to process a request and turn it into a response dictionary. That sounds
a lot like your controller to me ;-)
The CONTROLLER is the code that gathers all the pieces from
the model and constructs the python code
Slightly scared as to what "constructed the python code" might mean :-S
that is then fed to the engine
that then creates the view. And just because the controller navigates
the logic to dynamically contruct/render a view, that does not make 'it'
the view.
Well, for me, the MVC isn't really what happens anymore, here's my take:
- the model nowadays has all the "business logic" in it, rather than
just the data. The model is now a collection of objects that can be
interacted on through many/any UIs needed, some of which may be web apps.
- web apps are *always* a collection of request/response transactions.
As such, the "control" layer does just become a "view" that does that.
- singleton objects and other stuff that used to live in a "control" are
now factored out into utilities and services (of which zope.component
provides a pretty good abstraction, and doesn't really have anything to
do with Zope, other than the fact that Zope makes use of it).
Welcome to the 2nd decade in the new millenium ;-)
Chris
--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
--
http://mail.python.org/mailman/listinfo/python-list