Do you use the MVC pattern in you applications or not?
Moderator: General Moderators
Do you use the MVC pattern in you applications or not?
So... do you?
True enough, but I like the way it works. There aren't a lot of projects that I would do without using some kind of a framework (be it Zend, Code Igniter or my own). Aforementioned frameworks don't force you, but they do guide you into the principle of Model View Controller.Zu wrote:If the project requires a MVC, then yes. Often a project doesn't require that level of complexity.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
The Model/Presentation separation is probably 80% of MVC. There is no hard and fast rule as to where the dividing line is between the Controller and View, or even what the dependencies must be. So if you write modular code with clear/clean dependencies, the you are both using MVC -- whether you like it or not.feyd wrote:I'm the same.Buddha443556 wrote:I do my best to separate the presentation from the model. Any use of MVC pattern on my part is probably accidental because I don't spend much time worrying about patterns.
(#10850)
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
I am along those sames lines... somewhat. My current app I am building for work uses a controller that serves everything through index.php based on page name, that then gets thrust through the page rendering class which implements any modules for that page name, parses that pages template and outputs a page.Buddha443556 wrote:I do my best to separate the presentation from the model. Any use of MVC pattern on my part is probably accidental because I don't spend much time worrying about patterns.
If I said it was MVC it would probably make the die hard MVC coders puke, so I staying away from that classification. It is similar, but I would not say I use MVC.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
That's MVC for ya! I've seen more MVC topics than any other design pattern in my time.arborint wrote:So we have a poll about a little understood pattern that most people are not sure if they use or not...
It's always "controller" that gets confuddled with the layers either side of it. Controller is fairly minimal simply passing notes between the other two layers.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
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.
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.
(#10850)