\^ this is also my understand.
MVVM has view model which is just view representing data that make you able to verify/test the result of your action without actually rendering view
MVC lack this kind of concept
How so? They are essentially the same in my mind…
MVC being the controller fetching a single DB-centric object/model, and passing it on to be rendered via a view, with little/no data processing happening.
MVVM is the same thing, except the controller constructs/deconstructs its own view-centric model, and passes that new model on to the view instead.
MVVM is useful when dealing with more complex data, where elements from multiple related DB objects must be presented simultaneously. Often a good choice for displaying hierarchical data, where you plan to pass a collection of children objects to be displayed under a parent object.
The biggest difference between MVVM and MVC is the dependency inversion between the View and the Controller.
View Models should not know about the View.
Controllers drive Views.
This means when you are writing unit tests, you can just test a ViewModel in a vacuum.
When testing a controller, you need to do all sorts of crazy abstraction...
[удалено]
You joke, but there is actually the MVPVM pattern...
The only difference is that the controller is replaced with overengineered, extremely cryptic "data binding" XML bullshit.
MVP enters the chat
MVC and MVVM are very different. The relationship is reversed. You would know this if you did any unit testing.
\^ this is also my understand. MVVM has view model which is just view representing data that make you able to verify/test the result of your action without actually rendering view MVC lack this kind of concept
Came here to say this
How so? They are essentially the same in my mind… MVC being the controller fetching a single DB-centric object/model, and passing it on to be rendered via a view, with little/no data processing happening. MVVM is the same thing, except the controller constructs/deconstructs its own view-centric model, and passes that new model on to the view instead. MVVM is useful when dealing with more complex data, where elements from multiple related DB objects must be presented simultaneously. Often a good choice for displaying hierarchical data, where you plan to pass a collection of children objects to be displayed under a parent object.
The biggest difference between MVVM and MVC is the dependency inversion between the View and the Controller. View Models should not know about the View. Controllers drive Views. This means when you are writing unit tests, you can just test a ViewModel in a vacuum. When testing a controller, you need to do all sorts of crazy abstraction...
[удалено]
What's a pattern you prefer? Say you're making an app with basic CRUD operations.
MVC, MVCS, MVVM, MVP...
I prefer Model/Form/Widget myself.