Ok ... I'll humor you this once!josh wrote:Let's just humor my question? Let's say you write to your models in the view. What is the purpose of a controller anymore? How do you define what goes in a controller vs what does not anymore?
The purpose of the Controller is still Request processing and program flow. There are things like forwards that seem to be specific to the Controller. Remember the "the Controller" includes both the Front and Action Controllers in modern frameworks. There is still plenty for the Controller to do.
But there are also things like Access Control that are often done by both -- course grained control by the Controller (access to controller/action) and fine grained control by the View (displaying page item only for certain roles). So there is obviously functionality that both Controller and View both do.
Well talking about Model layer / Presentation layer separation is not something we disagree about. I think the separation between Controller and View is not as clear cut as the Model/Presentation layer separation. Even Fowler says the distinction between Controller and View is not a clear cut.josh wrote:I don't think MVC can be defined by a dependency diagram, like I said I could put my business logic in all 3 layers to intentionally make bad code, but if my dependencies are like that diagram it doesn't make it MVC, in my opinion. If I put all my view code in the controller, all my business logic in the view, and all my presentation logic in the "model" layer.... at some point you're going to call that "not MVC", lol. The question is how much code until it becomes not MVC? 1 line in the wrong place? 100 lines?
Which gets back to my question: Why should the View never be able to "write" to the Model?
