locked
What is difference between MVC MVP & MVVM design pattern RRS feed

  • Question

  • User88744855 posted

    if we search google using the above text called "What is difference between MVC MVP & MVVM design pattern" then we may get couple of url which discuss the difference between MVC MVP & MVVM design pattern theoritically but i have not found a single article which discuss the difference theoritically  along with sample code.

    it would be really nice if people get a article which discuss the difference between this 3 design patterns (MVC MVP & MVVM) alsong with a CRUD application. i want a CRUD should be develop following with 3 design patterns (MVC MVP & MVVM). so we can download the three apps code and run the code and understand how data flow in 3 design patterns and also people could understand how to write code for MVC MVP & MVVM.

    so if any such article exist which discuss how code would looks different for 3 design patterns (MVC MVP & MVVM) then please redirect me to there. thanks

    Thursday, October 17, 2013 3:55 AM

Answers

  • User-821857111 posted

    MVVM is not used in ASP.NET  but there are sample MVC and MVP applications around.

    MVVM is appropriate when the viewmodel is able to observe changes in the model. It is very much a client-focused pattern. It is used primarily in WPF, Silverlight and Javascript. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 17, 2013 9:09 AM
  • User-977076407 posted

    MVC:

    • Use in situations where the connection between the view and the rest of the program is not always available (and you can’t effectively employ MVVM or MVP).
    • This clearly describes the situation where a web API is separated from the data sent to the client browsers.  Microsoft’s ASP.NET MVC is a great tool for managing such situations and provides a very clear MVC framework.

    MVP:

    • Use in situations where binding via a datacontext is not possible.
    • Windows Forms is a perfect example of this.  In order to separate the view from the model, a presenter is needed.  Since the view cannot directly bind to the presenter, information must be passed to it view an interface (IView).

    MVVM:

    • Use in situations where binding via a datacontext is possible.  Why?  The various IView interfaces for each view are removed which means less code to maintain.
    • Some examples where MVVM is possible include WPF and javascript projects using Knockout.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 22, 2013 3:19 AM

All replies

  • User-821857111 posted

    MVVM is not used in ASP.NET  but there are sample MVC and MVP applications around.

    MVVM is appropriate when the viewmodel is able to observe changes in the model. It is very much a client-focused pattern. It is used primarily in WPF, Silverlight and Javascript. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 17, 2013 9:09 AM
  • User-977076407 posted

    MVC:

    • Use in situations where the connection between the view and the rest of the program is not always available (and you can’t effectively employ MVVM or MVP).
    • This clearly describes the situation where a web API is separated from the data sent to the client browsers.  Microsoft’s ASP.NET MVC is a great tool for managing such situations and provides a very clear MVC framework.

    MVP:

    • Use in situations where binding via a datacontext is not possible.
    • Windows Forms is a perfect example of this.  In order to separate the view from the model, a presenter is needed.  Since the view cannot directly bind to the presenter, information must be passed to it view an interface (IView).

    MVVM:

    • Use in situations where binding via a datacontext is possible.  Why?  The various IView interfaces for each view are removed which means less code to maintain.
    • Some examples where MVVM is possible include WPF and javascript projects using Knockout.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 22, 2013 3:19 AM