|
|
|
|
|
by adamjernst
4848 days ago
|
|
For webapps, I agree. There is no progression of state in a webapp's "controller" object: it's one shot and done. For native apps in frameworks like Cocoa Touch of course it's an entirely different ballgame. A view controller has quite a bit of state, usually some different modes, maybe some enforced state transitions. So the controller pattern makes a lot of sense there. The author is spot on about how some architectural oddities like one-method-classes come from Java's lack of functions as first class objects. |
|
[1] I blame this on MVC not making sense for Web backends; the controller is supposed to make sense of a stream of realtime user actions, but that doesn't apply so well to the discrete request/response model of HTTP. Your URL layout itself is, in effect, already doing most of the work of a GUI controller, and what's left is a relatively small bit of glue between the model and view. (Pyramid even bills itself as an MV framework; it refers to request handlers as "views", rather than reserving the name only for templates.)