Difference between asp.net MVC and MVP? are they both same?

Dalton picture Dalton · Nov 15, 2013 · Viewed 11.9k times · Source

I wanted to know the difference between asp.NET MVC and MVP, are they both same? below is the architecture diagram I referred.

(Image URL:http://msdn.microsoft.com/en-us/library/ff647859.aspx)

MVC vs MVP

the major difference I got to know between MVC and MVP from the diagram is, in MVC the Model updates the view and in MVP the Presenter updates the view.

But here is my confusion.Below is a asp.net MVC code sample.

public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            return View();
        }

    }

here the Controller returns/updates the view so now according to the diagram it is MVP

Is asp.net mvc and MVP similar? if not what is the difference ?Can someone guide me.

Answer

VahidNaderi picture VahidNaderi · Nov 15, 2013

Actually MVP is a subset of MVC pattern.

In your example of asp.net mvc the controller does not updates the view rather it just pass the model to the view and the view get updated according to the model.

But in MVP (which is usually used with winforms and webforms in Microsoft stack) the presenter get data from view, updates the model and when the model changed, the presenter will read the model and updates the view.