views:

86

answers:

3

I'm slowly getting into MVC, but it's still relatively new to me. From what I've discovered by doing a few tutorials, MVC provides an interface for communication between the database and the website and in general allows for better organization of the code.

Are there other significant advantages to using an MVC structure? What would be an example of a time when you wouldn't want to user MVC, even if you are communicating with a database?

Thank you!

+2  A: 

The pro/con list in this blog may help you understand when MVC makes the most sense to use.

http://www.ytechie.com/2008/10/aspnet-mvc-pros-and-cons.html

James Black
Good list. Thank you!
Eclyps19
+3  A: 

Technically speaking, MVC has nothing to do with whether or not an application uses a database. MVC is about separating concerns so that the things that represent business concerns and logic [the models] are separated from how the UI is displayed [the views]. It doesn't matter whether or not your models are stored in a database, on the filesystem, in memory, or not even persisted at all.

As for when would you NOT want to use MVC, that's harder to say. MVC is about separating concerns to simplify the construction and management of a software system. If you don't need those benefits, or if you get greater benefits through a different pattern (for instance, if you have a team that's highly skilled in a non-MVC based framework), then don't use it. It's certainly possible to build good software without using the MVC pattern, the pattern just helps.

Seth Petry-Johnson
Exactly what I was looking for. Thanks for breaking it down for me. Each of the tutorials I've done involved connecting to a database - I guess that's why I assumed it was required.
Eclyps19
+1  A: 

You can take a look at this video: Choosing the right programming model.

Since you indicated you're a beginner with MVC I suggest you take a look at these informative tutorials.

XIII