MVC - Model–View–Controller
(MVC) is a software architectural pattern mostly (but not exclusively)
for implementing user interfaces on computers. Traditionally used for desktop
graphical user interfaces (GUIs), this architecture has become extremely
popular for designing web applications.
MVC - Framework Library: Early web MVC
frameworks took a thin client approach that placed almost the entire model,
view and controller logic on the server. This is still reflected in popular
frameworks such as Ruby on Rails, Django, ASP.NET MVC, Spring MVC and Express.
Client technologies have matured; frameworks such as AngularJS, EmberJS,
JavaScriptMVC, SpineJS and Backbone have been created that allow the MVC
components to execute partly on the client.
MVP - Model-View-Presenter (MVP) is a derivation of the model–view–controller (MVC)
architectural pattern, and is used mostly for building user interfaces. MVP is
a user interface architectural pattern engineered to facilitate automated unit
testing and improve the separation of concerns in presentation logic:
- the view is a passive interface that displays data (the model) and routes user commands (events) to the presenter to act upon that data.
- the model is an interface defining the data to be displayed or otherwise acted upon in the user interface.
- the presenter acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view.
MVP - Framework Library: Client Side- Riot.js, GWT
whereas Server Side - Classic ASP.NET, JSP Servlets. In general
implementation of MVP:
- .Net Framework - Claymore, MVC# Framework, Web Client Software Factory, Evolution.Net MVP Framework, ASP.NET Web Forms Model-View-Presenter (MVP), Nucleo.NET, WinForms MVP
- Java Framework - JavaFX, MVP4J, Echo2, Google Web Toolkit, GWT-Platform, JFace, Swing, Vaadin, ZK
- PHP Framework - Nette Framework
MVVM - Model–View–ViewModel (MVVM) is a software architectural pattern. MVVM and
Presentation Model both derive from the model–view–controller pattern (MVC).
MVVM facilitates a separation of development of the graphical user interface
(either as markup language or GUI code) from development of the business logic
or back-end logic (the data model). Model–view–viewmodel is called model–view–binder,
especially in implementations not involving the .NET platform. ZK (a web
application framework written in Java) and KnockoutJS (a JavaScript library)
use model–view–binder. The MVVM pattern includes three key parts:
- Model (Business rule, data access, model classes)
- View (User interface (XAML))
- ViewModel (Agent or middle man between view and model)
MVVM - Framework Library: Client side - Knockout.js, Kendo
(MVVM) whereas Server side - WPF (Desktop) or Silverlight, Windows Phone
apps (XAML), Adobe Flex.
When to use which?
- MVC - Use in situations where the connection between the view and the rest of theprogram is not always available (and you can’t effectively employ MVVM or MVP)
- MVP - Use in situations where binding via a datacontext is not possible.
- MVVM - Use in situations where binding via a datacontext is possible.
Both MVP and MVVM are derivatives of MVC (see timelines
and how these have evolved). The key difference between them is the dependency
each layer has on other layers as well as how tightly bound they are to each
other.