locked
Why MVP design pattern is prefer for web form RRS feed

  • Question

  • User264732274 posted

    so many design pattern is there for interaction between UI and code like MVC, MVVM etc but i saw people prefer MVP for web form. i need reason so please share idea if some one follow MVP for webform.

    thanks

    Tuesday, September 29, 2015 9:18 AM

Answers

  • User-219423983 posted

    Hi sudip_inn,

    If you want to know why people choose the MVP pattern, you’d better first know what the MVP pattern is. The following thread provides an introduction of MVP comparing with MVC and you could have a look.

    http://stackoverflow.com/questions/2056/what-are-mvp-and-mvc-and-what-is-the-difference

    This thread is a discussion about when to use MVC and when to user MVP.

    http://www.dofactory.com/topic/1096/mvp-and-mvc-when-to-use-which.aspx

    This article provide a complete introduction about MVP that you’d better read carefully.

    http://aviadezra.blogspot.com/2007/07/twisting-mvp-triad-say-hello-to-mvpc.html#_edn5

    I hope it’s useful to you.

    Best Regards,

    Weibo Zhang

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 30, 2015 5:33 AM
  • User-821857111 posted

    but i saw people prefer MVP for web form
    In my experience, that's not true. Hardly anyone uses MVP in their Web Forms projects. As an architectural approach, MVP is very similar to MVC in that both are presentation patterns that promote separation of concerns so that testing etc is easier. Standard Web Forms is difficult to unit test because the "view" (aspx file) and the "presenter /controller" (code-behind file) are wedded so closely together.

    However, As deadtroll said, the MVP framework was never really successful because it had to battle with the inherent Page Controller architecture that Web Forms is based on. MVC is a more suitable solution so people use(d) that instead. If anyone is thinking of retrofitting an existing Web Forms site to comply with MVP, they will most likely find it quicker and more successful to migrate to MVC instead.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 30, 2015 8:55 AM

All replies

  • User37182867 posted

    MVP is forms based MVC. It's dead. Don't use it. If you want to use MVC style then use MVC project instead of web forms. Web forms was intended for Desktop developers to start developing web apps. It hides everything nice about the web and makes it feel like a desktop app. While this is great for rapidly churning out web pages, it makes it increasingly harder to incorporate new web technologies, even MVC styled validation methods are very difficult to implement in a web forms environment. It's just not designed to handle it. Examples of things that are hard to implement (not impossible, but harder than it should be) model validation, AJax (writing your own implementation), AngularJS, Knockout, (lots of client side coding is harder to implement in web forms than mvc due to the lack of control over the controls that you have with web forms.

    In short, MVP is dead. Ignore it. Nothing to see here. These are not the droids you're looking for. Move along. Move along.

    Tuesday, September 29, 2015 9:54 AM
  • User264732274 posted

    your post is not the answer for my question. still lots of people has their legacy apps on webform. so still people is using it. i just need reason why people use MVP pattern for webform........why not follow other pattern. if you know the reason then please share the knowledge. thanks

    Tuesday, September 29, 2015 10:13 AM
  • User-219423983 posted

    Hi sudip_inn,

    If you want to know why people choose the MVP pattern, you’d better first know what the MVP pattern is. The following thread provides an introduction of MVP comparing with MVC and you could have a look.

    http://stackoverflow.com/questions/2056/what-are-mvp-and-mvc-and-what-is-the-difference

    This thread is a discussion about when to use MVC and when to user MVP.

    http://www.dofactory.com/topic/1096/mvp-and-mvc-when-to-use-which.aspx

    This article provide a complete introduction about MVP that you’d better read carefully.

    http://aviadezra.blogspot.com/2007/07/twisting-mvp-triad-say-hello-to-mvpc.html#_edn5

    I hope it’s useful to you.

    Best Regards,

    Weibo Zhang

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 30, 2015 5:33 AM
  • User37182867 posted

    your post is not the answer for my question. still lots of people has their legacy apps on webform. so still people is using it. i just need reason why people use MVP pattern for webform........why not follow other pattern. if you know the reason then please share the knowledge. thanks

    As I was saying above, MVP is MVC for web forms. It was an idea that took off sometime in 2010 and was dead by 2013. Its dead because everyone found out that the extra complexity added on top of web forms was not worth it. It never got the same quality of validation and other support that MVC did and was only being written by a handful of people. I'm actually surprised when a developer has even heard of MVP yet alone actually put an MVP project into production. Also its been a "dead" or unsupported framework for so long if anyone does have it in production it would be time to upgrade it.

    Wednesday, September 30, 2015 7:59 AM
  • User-821857111 posted

    but i saw people prefer MVP for web form
    In my experience, that's not true. Hardly anyone uses MVP in their Web Forms projects. As an architectural approach, MVP is very similar to MVC in that both are presentation patterns that promote separation of concerns so that testing etc is easier. Standard Web Forms is difficult to unit test because the "view" (aspx file) and the "presenter /controller" (code-behind file) are wedded so closely together.

    However, As deadtroll said, the MVP framework was never really successful because it had to battle with the inherent Page Controller architecture that Web Forms is based on. MVC is a more suitable solution so people use(d) that instead. If anyone is thinking of retrofitting an existing Web Forms site to comply with MVP, they will most likely find it quicker and more successful to migrate to MVC instead.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, September 30, 2015 8:55 AM
  • User264732274 posted

    @Weibo i am trying to know why people follow MVP for webform ? why MVP is suited for webform because other pattern also exist then why not follow MVC or MVVM for webform. i got no relevant answer for this question still. thanks

    Wednesday, September 30, 2015 9:11 AM
  • User37182867 posted

    i am trying to know why people follow MVP for webform ?

    Nobody uses MVP. It was never widely used even at its height which peaked back in ~2012. It was never adopted for anything other than the novelty of the concept.

    Wednesday, September 30, 2015 9:47 AM