Views: 32.8K
Replies: 4
Archived
|
MVC versus MVP for a WinForms appI am starting up a relatively small project using WinForms. I have been reading up on patterns and MVC versus MVP. I see that MVC is widely used and very popular in Web development (hence the new ASP.NET MVC platform). However, for a WinForms app, I believe there are advantages to using MVP. Can someone confirm this and explain why? Thanks.
Juan Perez, Feb 07, 2010
|
|
Reply 1It is hard to say which ones are better, but from the separation of concerns principle it is preffered MVC over of MVP. It is important how you think your architecture and especially what your application does.
Nicolae Dima, Mar 30, 2010
|
|
Reply 2Nirajan Singh has given a pretty decent reply, so rather than adding anything I will just present my viewpoint.
For WinForm app MVP is a better choice, especially considering testability. Well as far as intelligent view is concerned, I will partially agree, as it's an open debate that where to put most of the logic. And considering testability, I think heavy use of the Presenter would be a better choice, but again, that's my opinion. Syed Saqib Ali Tipu, Mar 10, 2010
|
|
Reply 3Both in MVC and MVP the presentation layer consists of view objects, and application logic consists of controller\presenter objects. For each view object a corresponding controller\presenter exists and vice versa. And although MVC and MVP are based on a common 3-tier principle: views process only presentation needs and controllers\presenters handle application logic, these patterns have two major differences:
Nirajan Singh, Feb 15, 2010
|
|
Reply 4I am struggling with this a bit myself. From what I've read (not tried it yet) the impetus behind MVP was to "smarten up" the view. I believe in a pure MVC patten, we wouldn't want to take advantage of things on the client side like Data Binding or any type of data entry validation. With MVP, you get to use more of the richness provided by the platform.
I'd love to hear how you end up tackling this issue. I did find one website (don't have the link handy) that talked about using MVC / MVP in a WinForms world. Derek Lawless, Feb 12, 2010
|