Difference Between MVC and MVT Patterns
Brief
Both MVC and MVT are one of the famous design patterns. They are used for many web application frameworks. Here we examine the difference between them.
MVC
MVC is the abbreviation of Model View Controller. A Model View Controller pattern is made up of the following three parts.
Model − This is responsible for maintaining data. Handles database basically.
View − This is responsible for displaying all or a portion of the data to the user.
Controller − This is responsible for the interactions between the Model and View. It controls the data flow into Model and updates View when data is changed.
In accurate, there are 2 patterns of MVC.
- MVC 1
Trygve Reenskaug introduced into Smalltalk-79 firstly.
Observer pattern in GOF design pattern is one of the concrete examples of MVC 1.
- MVC 2
In 1998, what is proposed in the draft of the JSP specification, which adapted MVC 1 to web application. As comparing to MVC 1, there is no dependencies between Model and View.
MVT
MVT is the abbreviation of Model View Template. Python based framework Django adapted firstly. A Model View Template pattern is made up of the following three parts.
Model − This is responsible for maintaining data. Same as Model in MVC.
View − This is responsible for calling business logic or the interactions between the Model and View. View acts more like “Controller” of MVC2.
Template − This is responsible for User Interface, such as html.
Conclusion
MVC 1 and MVT are obviously different architectural pattern, while MVC 2 and MVT are mostly same. It seems to be fine that MVC 2 and MVT are same architectural pattern.
Reference
- https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller
- https://www.quora.com/What-is-the-difference-between-an-MVC-and-an-MVT-framework
- https://pythonistaplanet.com/difference-between-mvc-and-mvt/
- https://qiita.com/ffggss/items/15943c6c3908a6f25cb5
- https://qiita.com/tshinsay/items/5b1724baf32b8b5113c2