views:

409

answers:

4

What's the pros and cons of using a Model-View-Controller model in building your application?

+6  A: 

Pros

  • No business logic in UI
  • More Unit Testable
  • One size fits all solution (Well Almost..)

Cons .. I cant think of many

  • More work, but on the contrary IMHO it's time well spent
AB Kolan
Another plus: many modern interface/web frameworks are designed with MVC in mind.
Sam DeFabbia-Kane
+1  A: 

mvc is good because it's an organized way of separating business logic from front-end code. if you need to edit a data source for something you should know right where to look, for example. as a downside though it can be a lot of overhead for a smaller project, and may require more lead time for developers not already familiar with mvc.

taber
A: 

Depends on the size of the web application that is being developed. If the application is just a single page utility, with not much of business logic involved, then it does not make sense to take the MVC approach.

Otherwise MVC defenitly has its pros 1. Keeping the user interface changes completely separate from business logic. 2. helps in easier maintenance of code. 3. Easier to test the business components, user interface etc... 4. Secure as the UI pages will not be have the backend table structures/ other logic involved.

SS
A: 

Another pro (for some MVC frameworks anyway) is that you can let designers be designers and developers be developers.

Designers shouldn't be required to know anything about the programming of the models or controllers, only what goes in the views. In the case of web MVC frameworks this might mean that a designer would only really need to know HTML/CSS/JS to get their job done.

Developers on the other hand wouldn't really be interested in a div being 3px too far to the right. They only need to worry about the business logic.

Nathan