I was working on sketching out some ideas for a new project, and realized that I was having some difficulty getting things to fit into an MVC framework (In the case, CodeIgniter) In a way I liked. While I believed this can be overcome by working with the design some more and figuring out a better layout, It got me to thinking: could MVC not be the best answer here? and If not, when is using MVC a good idea for a project, and when is it not?
I feel like MVC could be used for any web app, but I'm wondering when is it not the best solution.
MVC (or more structured approaches in general) lend themselves very well to large scale applications where design consistency and segregation of code is a benefit outweighing the cost of supporting the design. If its a small site, or very few pages/controls, I would avoid sticking to strict design patterns.
A core principle of the MVC pattern is the view layer's ignorance with respect to the model layer. Views are dumb objects. They only know how to present data to the user. They don't know or understand what they are presenting.
MVC platform supports the development of SEO friendly web pages or web applications. Using this platform, it is very easy to develop SEO-friendly URLs to generate more visits from a specific application. This development architecture is commonly used in Test-Driven Development applications.
I think that MVC is almost universally applicable to web applications that we see today. But it doesn't mean that the framework you use is always up to supporting the types of things that you want to do.
MVC is just a pattern that applies well to the web. In particular it applies well to the idea that an application is accessed in the following way:
This is undeniably the way the web works, however most Web MVC frameworks start from the assumption that each user produces relatively few requests asking for big chunks of resources at a time. I have found that as web sites move frequent and smaller AJAX style requests lots of frameworks require some work to get them to play nicely because more and more of the 'view' part of MVC needs to be handled on the client. Framework support for this is nowhere near as mature as it is for server side views. However the central paradigm doesnt change much, and the central request - query - template loop is still there.
In short: MVC is a good way to think about the way your application works, but that doesn't mean you are going to find a pre written framework that handles all your needs.
The value of a MVC quickly vanishes when it's...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With