Do you use the MVC pattern in you applications or not?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Do you use the MVC pattern in you applications or not?

Poll ended at Sat Apr 14, 2007 2:47 am

Yes, I do.
14
82%
No, I don't.
3
18%
 
Total votes: 17

User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post 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.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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 :)
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I agree with d11 arborint. That was probably the cleanest explanation of MVC I have ever read.
Post Reply