MVC versus MVVM

4

I can not differentiate between either MVC or MVVM. What really differentiates MVC from MVVM? In job interviews, they sometimes ask just that, how you differentiate one from the other.

    
asked by anonymous 22.06.2017 / 15:08

1 answer

2

You can respond with a quote from Josh Smith:

  

If you put software architects into a room and have them discuss what the Model-View-Controller pattern is, you will end up with twelve different opinions.

That says if you put 10 developers to discuss MVC, there will be 12 different definitions. The MVVM is not so different, although it is newer, less used and with a definition of who created more clear.

Many standards are not well defined. I've had several discussions with several very intelligent people and never reached a definitive conclusion. So if the place you are applying is good, giving an answer explaining your point of view is better than giving a "sure" answer, because your answer may be right and they think it is wrong, or vice versa. Are you going to answer what? One of the twelve definitions that Josh Smith talks about?

What if they really want to know a definition? This is almost a lottery. And the place is probably not good for work. And I'm sorry to say that you do not have much to do if they do not accept an explanation of the problem.

Depending on the context, technology or environment, the setting may be different and correct.

Anyway an answer here will not help much because the question should not be if you know the definition but if you know how to use, then you need to study both deeply.

I will not explain each one because this already exists, as the comments show.

Difference

The summary of the difference between them is that MVVM has a facility to work with the specific model required for the view.

It is common that the model required by the view does not hit the source data model (often a database).

The ModelView layer will do the data-binding ) and the model producing another model more suitable and already worked to meet the vision and will take what the vision needs to request form most suitable for the model ( command ). In general, it is rich in the ability to manipulate this communication transparently. MVVM makes extensive use of default Observable notifications ).

Outside this depends on context and more detail of what you want to know, where it is being used, what the goal is.

Conclusion

Knowing how to argue is better than knowing what it is or even knowing how to do it.

In addition to the links in the comments, you can see what they are on Wikipedia ( MVC and MVVM ), you can see in Portuguese, but never think good.

    
22.06.2017 / 17:28