The Model-View-Control (MVC) pattern, originally formulated in the late 1970s, is a software architecture pattern built on the basis of keeping the presentation of data separate from the methods that interact with the data. In theory, a well-developed MVC system should allow a front-end developer and a back-end developer' to work on the same system without interfering, sharing, or editing files either party is working on.
Even though MVC was originally designed for personal computing, it has been adapted and is widely used by web developers' due to its emphasis on separation of concerns, and thus indirectly, reusable code. The pattern encourages the development of modular systems, allowing developers to quickly update, add, or even remove functionality.
MVC is an exercise in Separation of Concerns, a UI architecture. It is a way to corral the complexity that can occur in user interfaces due to the presentation not being separated from the content.
Model View Whatever aka MVW o MV* és un terme creat per Angular.js que indica la capacitat que té un Framework per poder treballar amb el paradigma MVC o si s'escau també amb MVVM. El programador pot escollir entre separar més la vista de la lògica de l'aplicació (MVC) o que el mòdel llegeixi els canvis en una vista per ell mateix i s'actualitzi MVVM
Vegeu Vue i la imatge:
MVVM is a variation of Martin Fowler's Presentation Model design pattern. Like Fowler's Presentation Model, MVVM abstracts a view's state and behavior. However, whereas the Presentation Model abstracts a view (i.e., creates a view model) in a manner that does not depend on a specific user-interface platform, MVVM was developed at Microsoft specifically to simplify event-driven programming of user interfaces—by exploiting features of Windows Presentation Foundation (their .NET graphics system) and Silverlight (WPF's Internet application derivative).
John Gossman, one of Microsoft's WPF and Silverlight architects, announced MVVM on his blog in 2005.
MVVM and Presentation Model both derive from the model–view–controller pattern (MVC). MVVM facilitates a separation of the development of the graphical user interface (either as markup language or GUI code) from the development of the business logic or back-end logic (the data model). The view model of MVVM is a value converter; this means that the view model is responsible for exposing the data objects from the model in such a way that the objects are easily managed and consumed. In this respect, the view model is more model than view, and handles most if not all of the view’s display logic. The view model may also implement a mediator pattern, organising access to the backend logic around the set of use cases supported by the view.
Terme interessant a: Model View Confusion
Exemple fet a mà des de zero de Patró MVC (vegeu MVC i PHP):
Un altre exemple de Laracasts: