Software | Web | Database

Igniting Creativity

Experts who communicate, understand, create, and deliver

Did you Know?

More than 2/3 of all homes in the U.S. have a broadband Internet connection. Are you reaching your customers?

Model View Controller

What is MVC?

Model-view-controller (MVC) is a design pattern for websites that separates business logic from the user interface. This allows for an easier time when modifying the website, either changing the user interface without changing the backend data, or changing the business rules without changing the look and feel of the website.

In MVC, the Model controls the business logic, holding the state of the application that is then passed to the presentation layer. The View is what actually contains the presentation logic, the bells and whistles of the user interface. The Model and View do not interact with each other directly; instead they use a controller to determine which model and view to use.

One of the key benefits to using MVC in web applications is the reusability of code. When building an application, one model can be used for many views, and many types of views, resulting in the business logic not having to be duplicated when crossing technology. For instance, if a webpage was built today with the view as standard HTML, but later on in the future needs changed to be used with WAP, all of the business logic would need to be created and updated for the new technology. However, using MVC, only the view would need to be changed to WAP, and all data access and business logic would remain intact.

The reverse of this is also a key benefit, changing the Model. If a database server is upgraded, or the underlying data structure is changed, the only changes to the application are needed on the Model. The View will still be able to handle the information retrieved from the Model. With MVC, applications are easily customized, and allow for a high degree of scalability.