Dofactory.com
Dofactory.com
 Back to list
Views:   11.6K
Replies:  1
Archived

difference between MVC and MVP

Hello 
          I am new to the forum .Can some on please explain me what is the difference between MVC and MVP.

Example will be highly appreciated 

Regards
Itman Man, Oct 21, 2011
Reply 1
Apart for the theoretical definition which you might easily get by googling, the following are some of the important points with respect to MVC and MVP

-  Both provide abstraction of presentation and presentation logic.
-  MVP is a bit more complex to implement than MVC also it has additional layer for view interfaces.  (but this can be blessing in disguise, if you are looking for sharing presentation logic across windows, web and other things..)
-  In MVC the request is received by the controller which in turn gets the required data and loads up the appropriate view
-  In MVP the request is always received by the View and delegated to the presenter which in turn gets the data does the processing
-  In MVC the controller logic can be unit tested (also you can unit test view if you are using Razor view engine.  ASPX viewengine are not that easily unit testable)
-  In MVP presentation and view logic an be unit tested as the view is loosely coupled.

For web programming I prefer MVC and for windows including WPF I prefer MVP as the flow naturally tend towards this pattern.



Rajesh Pillai, Oct 28, 2011
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Cookies       Do Not Sell       Licensing      
Made with    in Austin, Texas.  - vsn 44.0.0
© Data & Object Factory, LLC.