• Like
Mvc, mvp, mvvm.pptx
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Mvc, mvp, mvvm.pptx



  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads


Total Views
On SlideShare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. MVC, MVP, and MVVM A comparison of model- view separation architectural patterns1
  • 2. 2 A pattern is a solution to a well-understood problem
  • 3. 3 An architectural patternsolves architectureproblems
  • 4. 4 The SmartUI pattern is where youhave logic in the code-behindPros Cons›  Fast ›  Rigid›  Easy to code ›  Resistant to change ›  Unforgiving
  • 5. 5 MVC, MVP, and MVVM are allsolving this problem›  Get the logic out of the UI›  Loosely coupled›  Reusable›  Unit-testable›  UI designers can work on the UI
  • 6. 6 Note that they all have a modeland a view
  • 7. 7 The Model is pure business logic›  Completely unaware of the other components›  Very unit-testable
  • 8. 8 The view deals with UI only›  Itdisplays data from the model›  Should be kept as thin as possible
  • 9. Browser Controller How MVC works 10 Model View
  • 10. Browser Presenter How MVP works 13 Model View
  • 11. Browser l ViewMode 17 How MVVM works Model View
  • 12. 20 MVC vs. MVPMVC MVP›  User hits the C first ›  Userhits the V first›  V can switch Cs ›  One V to One P›  C talks to V, but V cant ›  Two-way talk to C communication›  C has a reference to the between V and P V ›  V has a reference to the›  V has a reference to the P M ›  V cant see M
  • 13. 21 MVC vs. MVVMMVC MVVM›  C is much more ›  VM is much simpler – It powerful than a VM just ties the V to the M›  User hits the C first ›  User hits the V first›  The view knows about ›  V cant see the M the model ›  V has an instance of the›  V gets an instance of VM the M ›  One VM per V
  • 14. 22 MVVM vs. MVPMVVM MVP›  M is a business object ›  M is a UI thing, not a business thing
  • 15. 23 So which should I choose?›  MVC is best for web applications›  MVP is best for windows forms›  MVVM is best for WPF and Silverlight
  • 16. 24 Conclusion›  All three architectural patterns solve the problems of rigidity and fragility›  They are significantly more work for small projects›  But they pay for themselves with larger projects once you learn the patterns
  • 17. 25 Further study›  http://joel.inpointform.net/software-development/ mvvm-vs-mvp-vs-mvc-the-differences-explained/›  http://russelleast.wordpress.com/2008/08/09/ overview-of-the-modelview-viewmodel-mvvm- pattern-and-data-binding/›  http://rachelappel.com/comparing-the-mvc-and- mvvm-patterns-along-with-their-respective- viewmodels›  http://geekswithblogs.net/dlussier/archive/ 2009/11/21/136454.aspx