View stunning SlideShares in full-screen with the new iOS app!Introducing SlideShare for AndroidExplore all your favorite topics in the SlideShare appGet the SlideShare app to Save for Later — even offline
View stunning SlideShares in full-screen with the new Android app!View stunning SlideShares in full-screen with the new iOS app!
Browser l ViewMode 17 How MVVM works Model View
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
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
22 MVVM vs. MVPMVVM MVP M is a business object M is a UI thing, not a business thing
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
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