Saturday, December 8, 2007

MVC vs MVP

MVC or MVP? You've probably heard about Microsoft's new ASP.NET MVC Framework.

MVC methodology divides an application's implementation into three component roles:

  • Models
  • Views
  • Controllers.

MVP approach divides an application's implementation into:

  • Model
  • View
  • Presenter

What is the difference between the  MVC and MVP patterns?  Todd Snyder has an excellent explanation. This is summary by the key differences between the two patterns:

MVP MVC
View is more loosely coupled to the model. The presenter is responsible for binding the model to the view Controller are based on behaviors and can be shared across views
Easier to unit test because interaction with the view is through an interface Can be responsible for determining which view to display
Usually view to presenter map one to one. Complex views may have multi presenters  

 

Technorati Tags: ,,

No comments: