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)
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With