Difference between MVC and MVT design patterns

1. Model View Controller (MVC) :
It is a software design pattern that is used to implement user interfaces and gives emphasis on separating data representation from the components which interact and process the data.

It has 3 components and each component has a specific purpose:

  • This Model is the central component of this architecture and manages the data, logic as well as other constraints of the application.
  • The View deals with how the data will be displayed to the user and provides various data representation components.
  • The Controller manipulates the Model and renders the view by acting as a bridge between both of them.

2. Model View Template (MVT) :
This is yet another design pattern similar to MVC. It is also used for implementing web interfaces and applications but in contrast to MVC, the controller part is taken care for us by the framework itself.

It has 3 components and each component has a specific purpose:

  • This Model similar to MVC acts as an interface for your data and is basically the logical structure behind the entire web application which is represented by a database such as MySql, PostgreSQL.
  • The View executes the business logic and interacts with the Model and renders the template. It accepts HTTP request and then return HTTP responses.
  • The Template is the component which makes MVT different from MVC. Templates act as the presentation layer and are basically the HTML code that renders the data. The content in these files can be either static on dynamic.

Difference between MVC and MVT design patterns :

S.NO. Model View Controller (MVC) Model View Template (MVT)
1. MVC has controller that drives both Model and View. MVT has Views for recieving HTTP request and returning HTTP response.
2. View tells how the user data will be presented. Templates are used in MVT for that purpose.
3. In MVC, we have to write all the control specific code. Controller part is managed by the framework itself.
4. Highly coupled Loosely coupled
5. Modifications are difficult Modifications are easy
6. Suitable for development of large applications but not for small applications. Suitable both small and large applications.
7. Flow is clearly defined thus easy to understand. Flow is sometimes harder to understand as compared to MVC.
8. It doesn’t involve mapping of URLs. URL pattern mapping takes place.
9. Examples are ASP.NET MVC, Spring MVC etc. Django uses MVT pattern.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

3


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.