Page 2 of 2

Posted: Wed Apr 04, 2007 5:34 pm
by Jenk
all the time, even when doing simple one page procedural scripts. To apply the MVC pattern does not require a model object, and a view object, and a controller object - they can be functions, methods of the same class, or even sections of the same file. It's only the separation that counts.

Posted: Wed Apr 04, 2007 5:50 pm
by Chris Corbyn
arborint wrote:I think maybe a confusing thing about the Controller is that it is sort-of defined by not being the View. I mean that in the sense that the Controller is the non-output code in the presentation layer. The Controller is about program flow. For example, you may have two views of the same data: tabular HTML and an XML data feed. The program flow is essentially the same, and the Model is obviously the same.

This gets to the essence of separations --- they are about defining modules, especially for reuse. Views are modular outputters. Models are modular data sources. Controllers are modular request managers. And those are the essential modules of an application.
That just read like poetry. Beautifully explained :)

Posted: Wed Apr 04, 2007 5:53 pm
by RobertGonzalez
I agree with d11 arborint. That was probably the cleanest explanation of MVC I have ever read.