Benefits of MVC over MVP

Possible Duplicates:
What are MVP and MVC and what is the difference?
mvc and mvp pattern

Folks,

What are some of the benefits of using MVC over MVP? I like that I don't have to use a framework for MVP and can be implemented via interfaces and classes. I still get the separation of concerns that MVC has and I get unit testing. What are some benefits of using MVC over MVP?


I wasn't even aware of "MVP" but haack[overflow] has a pretty good looking article...

Everything You Wanted To Know About MVC and MVP But Were Afraid To Ask

At the risk that Haack blocks cross linked images...Haack says the difference is clear :) alt text http://haacked.com/images/haacked_com/WindowsLiveWriter/MVCandMVPPatternResources_71CE/WinMerge%20-%20%5BMVP.txt%20-%20mvc.txt%5D_3.png


Since I have been scrutinized by my comments about duplicates, I will just reference this SO questions and leave it to the "higher powers" to close if they see fit :P
What are MVP and MVC and what is the difference?


People get too hung up on initials and TLA's sometimes.

If what Phil Haack says in his article is true, I thought I was using MVC in ASP.NET MVC, but what I am really using is MVP (or a tweaked form of MVC).

With MVC, it's always the controller's responsibility to handle mouse and keyboard events. With MVP, GUI components themselves initially handle the user's input, but delegate to the interpretation of that input to the presenter.

But that's not what ASP.NET MVC is really all about.

If I handle mouse and keyboard events, I like to do it in the browser with jQuery. That separates the user interaction from the controller, and provides for better decoupling between the UI layer and the "business" layer.

If I need to update part of my page using an AJAX call or JSON call, I am still going to need to do that anyway, whether I call it MVC or MVP.

ASP.NET WebForms, for example, attempts to emulate the rich client development paradigm via the use of ViewState. This is why many attempts to apply patterns to ASP.NET focus on the MVP pattern because the MVP pattern is more appropriate for a rich client application with GUI components.

However, many web platforms embrace the stateless nature of the web and forego attempting to simulate a state-full rich client development environment. In such systems, a tweaked MVC pattern is more applicable.

It is clear that Phil views (a tweaked form of) MVC as a move to a more stateless, thinner client, whereas MVP places more responsibility on the UI layer for providing a rich user experience.

Whether this is a good thing or not is subjective. If ASP.NET is MVP and ASP.NET MVC is MVC, I'll gladly accept the MVC initials to give up things like viewstate and obtuse logic.

链接地址: http://www.djcxy.com/p/30190.html

上一篇: MVC和MVP监督控制器是一样的吗?

下一篇: MVC优于MVP的好处