What is a reference point in an MVVM template?

When it comes to the MVC pattern, I always thought of the controller as a rod. That is, the one that receives all the actions that the user wants to perform, and then decides which model and view to use to complete the action requested by the user. (My experience with MVC is through Asp.net, and so I think about how routes are used to select the right controller, which then loads the model and selects and creates the appropriate view).

Is there a point in the MVVM pattern? Is the pivot the fact that the user interacts with the pivot point, which can lead to the fact that another model will be loaded and presented to the user using the appropriate virtual machine?

Also, where is the logic that usually resides in the MVC that sits in the MVVM pattern?

+3
source share
4 answers

MVVM is more distributed than MVC. View and view models are usually associated during development, which means that the virtual machine does not perform the same function as the MVC. This is more of a pure coordinator than a controller - a good presentation model usually has relatively little decision logic.

MVVM , . MVC . MVC , . MVVM , .

MVVM , , , MVC. , . MVVM - ? . , . " ", .

+4

, MVVM . , . . ViewModel.

MVVM M ↔ VM ↔ V

, .

+2

, MVVM . , , . , . VM .

, MVVM ; , - . Csla , "" .

0

MVVM . , MVC. , .

If you click on a button on an asp.net page, you click on it, just like putting a button on a silverlight page. The model of this view, when using MVVM, will handle all the actions that must be performed to manage the data. The view will respond (via binding) accordingly. In MVC, the controller determined what action the form should take for the model.

So, M and C in MVC "View Model" are combined into one M in MV "View Model".

0
source

Source: https://habr.com/ru/post/1794921/


All Articles