tags:

views:

87

answers:

3

Many frameworks are based on mvc, but I have no idea about MVC. So what is the use of MVC? Is it for speed, security or any other reason?

A: 

MVC is mostly for better maintainability of your code. By separating the database logic from the presentational logic from the controller logic you can make changes/rewrites/maintence more easily.

Atomix
+2  A: 

MVC allows you to separate your business logic from your presentation layer. This "Separation of Concerns" allows you to quickly find and edit portions of your code. It also enables easy reuse of your UI components across your system.

Check out the wiki page for a overly academic and technical introduction to MVC http://en.wikipedia.org/wiki/Model_view_controller

Ziplin
A: 

it also solves the problem of "spaghetti code", you can outsorce your HTML/XML/PDF/XSL creation Code to your View/Template engine, get the Data from Your Model(DB/File/RemoteCall,...) and your Controller controls the behaviour of Both, you can also simply exchange the View/Models without even Change the Controller if u implement it right, so you gain Seperation of Concerncs, get better Code & Maintainability and can easily swap components also its easier to manage if your projects grow. I recommend the Usage of a FrontController which selects the right Controller for you depending on the Users input, you can also use Inversion of Control/DependencyInjection Pattern there and let your Controller be configued by your FrontController / Pass DB Connection and lots of lots of lots more funny stuff Now u got a simple application framwork:) Use Zend Instead:)

w13531