Ps:http://waf.codeplex.com/wikipage?title=model-view-viewmodel%20pattern&referringtitle=documentation
Model-view-viewmodel Pattern
Common ABBREVIATIONS:M-V-VM or MVVM
Introduction
Separating user interface code from everything else was a key principle in well-engineered software.
Separating a key principle from the software design
But it's not always easy-to-follow and it leads to more abstraction in an application that's hard to understand.
But the more abstractions in the application are hard to understand.
Quite a lot design patterns try-to-target this scenario:mvc, MVP, supervising Controller, Passive View, Presentationmodel , Model-view-viewmodel, etc.
Many design patterns strive to implement these scenarios: MVC,MVP, management controller, passive view, presentation layer model,
The reason for this variety of patterns is, this problem domain was too big to being solved by one generic solution.
The reason for all kinds of patterns is that the general-purpose solution is too difficult to solve the problem.
However, each UI Framework have its own unique characteristics and so they work better with some patterns than with others.
However, each UI framework has its own unique characteristics, so some patterns are more appropriate than others.
The WPF application Framework (WAF) provides support for the Model-view-viewmodel Pattern because this one works best with Windows Presentation Foundation (WPF) applications.
WAF supports the MVVM pattern because it can perform well in the user interface framework that Microsoft has introduced.
This pattern is also known as Presentationmodel pattern.
This pattern is considered to represent the model.
Definition
Represent the state and behavior of the presentation independently of the GUI controls used in the interface.
State and behavior representations of interfaces not related to GUI controls
A Popular description of this design pattern was done by Martin Fowler.
Martin Fowler's description of a popular design pattern
In he article the pattern is called Presentationmodel and it is the same pattern.
But the same design pattern in his article is called the presentation model.
You can read his article online in his website.
You can read his articles on his website.
The following chapters describe our specific. NET implementation of this design pattern.
We have specifically used. NET to implement the design patterns described in the article.
Structure
The following UML class diagram shows the collaborating classes of this design pattern in a logical layered architecture.
The UML class diagram below the logical layer shows the collaboration of the various classes in the design pattern.
participants participants
The types participating in this pattern is:
View contains the specific GUI controls and defines the appearance of the user interface.
IView declares the interface of the View.
The types of parameters in the pattern are:
The view contains special GUI controls and the user interface that appears.
The ViewModel can communicate over this interface with the View.
ViewModel through interface and View communication.
Related pattern:separated Interface (POEA).
About patterns: Separate interfaces
ViewModel represents the state and behavior of the presentation.
ViewModel represents the state and behavior of the presentation layer
Model can is a business object from the domain layer or a service which provides the necessary data.
Model is the domain layer of the business object or the service layer that provides the necessary data.
Controller is responsible for the workflow of the application. Furthermore, it mediates between the ViewModels.
The controller is responsible for the workflow application. Besides, he is somewhere between ViewModels.
So it promotes loose coupling is keeping the ViewModels from referring to each other explicitly.
It facilitates the explicit keeping of ViewModels loose coupling involving other
Related patterns:application Controller (POEA), Mediator (GoF)
Related modes: Application Controller, Broker mode
Remarks Notes
The introduction of the interface IView is a variation of the model-view-viewmodel pattern.
IView is a variant of the Model-view-viewmodel pattern.
It allows the ViewModel to call properties and methods on the View.
Allows ViewModel to invoke the properties and methods in view in view.
The Controller class is a part of this design pattern.
The controller is not part of the design pattern.
The controller is supported by the WPF application Framework (WAF) and so this article shows how the controller works Toge Ther with the M-V-VM pattern.
The controller supports WAF, so this article shows how the controller works with the MVVM pattern.
Translate a little bit every day: WPF application Framework (WAF)