Model-View-Controller Pros and Cons

12,219

Solution 1

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

Solution 2

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.

Solution 3

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.

Solution 4

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.

Share:
12,219
RCIX
Author by

RCIX

Lua is underrated!

Updated on June 15, 2022

Comments

  • RCIX
    RCIX almost 2 years

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

  • Sam DeFabbia-Kane
    Sam DeFabbia-Kane almost 15 years
    Another plus: many modern interface/web frameworks are designed with MVC in mind.