MVC versus MVVM

Asked

Viewed 1,880 times

6

I cannot differentiate between both MVC or MVVM. What really differentiates the MVC from the MVVM? In job interviews, sometimes they ask you exactly that, how do you differentiate one from the other.

  • 2
  • 2

    Possible duplicate of What is MVP and MVVM?

  • 3

    MVP is not the same as MVC

  • 2

    I think that together with this it gives dup: https://answall.com/q/55486/101

  • On the mustache link I saw nothing about MVVM

1 answer

5


You can answer with a quote from Josh Smith:

If you put ten software Architects into a room and have them discuss what the Model-View-Controller Pattern is, you will end up with Twelve Different opinions

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

Many patterns are not well defined. I have had several discussions with several very intelligent people and never reached a definitive conclusion. So if the place you’re applying for is good, giving an answer explaining your point of view is better than giving a "right" answer, because your answer may be right and they think you’re wrong, or vice versa. Will you answer what? One of the twelve definitions that Josh Smith speaks of?

What if they really want to know a definition? That’s almost a lottery. And the place is probably not good to work at. And I’m sorry to say that you don’t have a lot to do if they don’t accept an explanation of the problem.

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

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

I am not going to explain each one because it already exists, as the comments show.

Difference

The summary about the difference between them is that the MVVM has a facility to work out the specific model needed for vision.

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

The Modelview layer will communicate the vision (data-Binding) and the model producing another model more suitable and already worked to meet the vision and will pick up what the vision needs to request most suitable to the model (command). In general it is rich in ability to manipulate this communication transparently. MVVM makes much use of the observable pattern (Notifications).

Otherwise it depends on context and more details of what you want to know, where you’re using it from, what the goal is.

Completion

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

Besides the links in the comments, you can see what they are on Wikipedia (MVC and MVVM), you can see in English, but I never think it’s good.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.