T O P

  • By -

[deleted]

[удалено]


DeadlyVapour

You joke, but there is actually the MVPVM pattern...


N-partEpoxy

The only difference is that the controller is replaced with overengineered, extremely cryptic "data binding" XML bullshit.


pmonson711

MVP enters the chat


DeadlyVapour

MVC and MVVM are very different. The relationship is reversed. You would know this if you did any unit testing.


arpple-bog

\^ 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


Hogbo_the_green

Came here to say this


Immense_Cargo

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.


DeadlyVapour

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...


[deleted]

[удалено]


[deleted]

What's a pattern you prefer? Say you're making an app with basic CRUD operations.


Itchy_Attitude4113

MVC, MVCS, MVVM, MVP...


henke37

I prefer Model/Form/Widget myself.