locked
MVC vs. MVP vs. MVVM RRS feed

  • Question

  • User-1086547871 posted

    ASP.NET MVC is a framework that implements the MVC pattern, however with WPF and Silverlight Microsoft seems to be pushing for MVP or MVVM. I am wondering if it makes sense to implement an MVVM patter that can use WinForms, WebForms, ASP.NET MVC (if possible), WPF, or Silverlight for the View... IOW, the View should be abstracted in a way that makes migration to new or different UI much easier.

    I am asking because we are using WinForms currently (customer mandated), but want to make sure we are using a pattern that will give us as much flexibility to migrate in the future if market/business needs demands that we change this.

    Any thoughts or advice on how to sort this out will be most helpful.

    Monday, February 1, 2010 12:49 PM

Answers

  • User197322208 posted

    I am hoping to use CSLA for the model.

    CSLA is awesome - just that it takes time to grok and to use. And, when I've done integration with database, it was somewhat painfull.

    But I am anxious to find from you!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 1, 2010 5:22 PM
  • User437720957 posted

    Does it make sense? Well, it definitely sounds like a good idea, but in reality it's mostly a pipe dream. First, we have the technical problems...

    Does it work?

    The web is stateless. ASP.NET WebForms tries to give the impression of statefullness, and it while it succeeds in many respects, it does so at the cost of increased complexity and reduced performance. Even if you introduce MVP or MVVM, it is very likely that you will have to have to introduce shortcuts and make crippling adaptations, just to make it work.

    Is it worth it?

    I'd say that only 1% (just a guess) of all applications which have been built with the "if market/business needs demands that we change this" sentence in mind never ever actually go in that direction. Instead so much unnecessary abstraction and complexity is introduced that it actually jeopardizes the entire project.

    Do you really want it?

    While there are certainly are many web applications (especially WebForms) that have interfaces which mimic Windows interfaces, I'd say that the most successful and usable web apps are those that embrace the fact that they are running in a web browser. The responsiveness can be improved by a bit of AJAX et. al., but they still have a rather distictive web behavior. Interestingly enough, there is a bit of motion in the other direction, with Windows apps and Windows itself starting to behave more like web apps (clickable links, back/forward buttons etc.), but I still think that striving for a common Web/Windows interface is crippling the user experience.


    Sharing a common pattern for WPF and Silverlight may make quite a bit of sense though, since they are so similar. WinForms could certainly be used with MVVM, but MVP is a better fit. WebForms works best with MVP, but not likely with a WinForms shared implementation. ASP.NET MVC is not a good fit for anything other than the type of MVC it employs by default.

    IMHO.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 3, 2010 6:23 PM

All replies

  • User197322208 posted

    You see,I am asking myself this.

    Only thing I know is that IDataErrorInfo and Business Layer are good for all.

    I think about how to implement security in an easy way for all (WPF, Windows forms, ASP.NET, ASP.NET MVC,Silverlight).

    And , about view code - the models are much different to can have one for all...




    Monday, February 1, 2010 4:46 PM
  • User-1086547871 posted

    And , about view code - the models are much different to can have one for all...

    I am hoping to use CSLA for the model.

    Monday, February 1, 2010 5:06 PM
  • User197322208 posted

    I am hoping to use CSLA for the model.

    CSLA is awesome - just that it takes time to grok and to use. And, when I've done integration with database, it was somewhat painfull.

    But I am anxious to find from you!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, February 1, 2010 5:22 PM
  • User437720957 posted

    Does it make sense? Well, it definitely sounds like a good idea, but in reality it's mostly a pipe dream. First, we have the technical problems...

    Does it work?

    The web is stateless. ASP.NET WebForms tries to give the impression of statefullness, and it while it succeeds in many respects, it does so at the cost of increased complexity and reduced performance. Even if you introduce MVP or MVVM, it is very likely that you will have to have to introduce shortcuts and make crippling adaptations, just to make it work.

    Is it worth it?

    I'd say that only 1% (just a guess) of all applications which have been built with the "if market/business needs demands that we change this" sentence in mind never ever actually go in that direction. Instead so much unnecessary abstraction and complexity is introduced that it actually jeopardizes the entire project.

    Do you really want it?

    While there are certainly are many web applications (especially WebForms) that have interfaces which mimic Windows interfaces, I'd say that the most successful and usable web apps are those that embrace the fact that they are running in a web browser. The responsiveness can be improved by a bit of AJAX et. al., but they still have a rather distictive web behavior. Interestingly enough, there is a bit of motion in the other direction, with Windows apps and Windows itself starting to behave more like web apps (clickable links, back/forward buttons etc.), but I still think that striving for a common Web/Windows interface is crippling the user experience.


    Sharing a common pattern for WPF and Silverlight may make quite a bit of sense though, since they are so similar. WinForms could certainly be used with MVVM, but MVP is a better fit. WebForms works best with MVP, but not likely with a WinForms shared implementation. ASP.NET MVC is not a good fit for anything other than the type of MVC it employs by default.

    IMHO.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 3, 2010 6:23 PM