Thursday, June 4, 2009

MVC vs. MVP: A question of pride?

My MVC with WebForms article generated an interesting comment that it was closer to MVP (model-view-presenter) and WebForms cannot or is not MVC. I replied with a point I think is relevant: we need to frame discussion around the pattern vs. the implementation. Microsoft MVC is an implementation, but I would suggest that having URL routing or having actions that return a view is part of an implementation, not fundamental to the MVC pattern.

Anyway, after some digging around to see where these ideas actually evolved from to get to where they are today, I found a very interesting article on GUI architectures that discusses both MVC and MVP.

My favorite take from the whole article:

As a result there's been a steady movement to design UIs in such a way that minimizes the behavior in objects that are awkward to test. Michael Feathers crisply summed up this approach in The Humble Dialog Box. Gerard Meszaros generalized this notion to idea of a Humble Object - any object that is difficult to test should have minimal behavior. That way if we are unable to include it in our test suites we minimize the chances of an undetected failure.

A question of pride? We need to code more humble objects. Seriously!

Jeremy Likness