Model–view–viewmodel: Difference between revisions

Content deleted Content added
Line 41:
'''View model:''' the view model is a “model of the view” meaning it is an abstraction of the view that also serves in mediating between the view and the model which is the target of the [[Data binding|view data bindings]]. It could be seen as a specialized aspect of what would be a controller (in the MVC pattern) that acts as a converter that changes model information into view information and passes commands from the view into the model. The view model exposes public properties, commands, and abstractions.
The view model has been likened to a conceptual state of the data as opposed to the real state of the data in the model.<ref>{{cite web|author = Pete Weissbrod |title= Model-View-ViewModel Pattern for WPF: Yet another approach.
| url = http://www.acceptedeclectic.com/2008/01/model-view-viewmodel-pattern-for-wpf.html}}</ref> The term '''"View model"''' is a major cause of confusion in understanding the pattern when compared to the more widely implemented [[Model–view–controller|MVC]] or [[model-view-presenter|MVP]] patterns. The role of the controller or presenter of the other patterns has been substituted with the framework binder (e.g., [[XAML]]) and view model as mediator and/or converter of the model to the binder.
 
'''Controller:''' some references for MVVM also include a controller layer or illustrate that the view model is a specialized functional set in parallel with a controller, while [http://karlshifflett.files.wordpress.com/2008/11/wpflobmvvm-thumb1.png others do not]. This difference is an ongoing area of discussion regarding the standardization of the MVVM pattern.