tags:

views:

158

answers:

2

Hello, I'm a little bit confused about these two programming patters: MVC and MVP.

Which are the main differences between them?; I have been searching on the net and I made a couple of examples of both of them, but I'm even more confused, because in some sample web pages MVP uses more than 2 interfaces to communicate the presenter with the view layer (some ones even have completely blank interfaces, only declarated), but in other ones it only takes two interfaces to transport data from presenter to view. Which is the correct way of applying that pattern?

On the other hand, I have been working on MVC for a while, but until now, I realize that maybe I had been aplying the pattern in the wrong way. I have had this:

  • Model: C# classes that behaves like the bussiness objects.
  • Controller: C# classes that uses the model objects to fill them or manipulate them.
  • View: C# aspx pages to show the model objects; the controller is the responsible of sending the model objects to this layer after manipulating and/or filling them with data.

I hope you can clear my doubts. Thanks in advance.

A: 

I can't say it much better than Mr. Fowler. So I'll point you to a good source.

-- MVP -- (Note MVP has been split into the below)

http://martinfowler.com/eaaDev/SupervisingPresenter.html

&

http://martinfowler.com/eaaDev/PassiveScreen.html

-- MVC -- (About 35-40% down the page)

http://martinfowler.com/eaaDev/uiArchs.html

decompiled
Well, your web links answer the main question: "when to apply each of them". That's why I mark your post as my answer. Thanks.
lidermin