Download presentation
Presentation is loading. Please wait.
Published bySaija Karvonen Modified over 5 years ago
2
Architecting Silverlight Applications with MVVM
Shawn Wildermuth President AgiliTrain Session Code: WIA301
3
The Problem
4
The Problem (2) Tight Coupling Adds Complexity Simple Changes Cascade
Difficult to Test Difficult to Develop Large Applications
5
Separation of Concerns
Loose Coupling Layers are Individually Responsible Established Patterns Lessens the Need to Reinvent Architecture
6
Patterns Model-View-Controller Model-View-Presenter
Model-View-ViewModel
7
Patterns (2) XAML is Declarative Allows for Code-less Views
Older Patterns Don’t Fit
8
Model-View-ViewModel
9
Model-View-ViewModel (2)
Silverlight XAML View C#/VB ViewModel Model Internet Server C#/VB Services
10
Building the MVVM Planning on MVVM Build in Tiers Plan for Testing
11
Building the MVVM (2) The Model Expose Data as Collections
Expose Methods for Different Data Shaping More than one ViewModel May Use a single Model Build Interface Providing Data Allows Mocking of the Database if necessary Eliminate Tight Coupling of Services with Model
12
demo The Model
13
Building the MVVM (4) The ViewModel Expose API that the View Needs
Use the Model to Provide the Data
14
demo The ViewModel
15
Building the MVVM (6) The View Declarative UI
Use as Much XAML as Possible Don’t Write Code to Rebind Data Perfect View is Code-less In Silverlight 3 Behaviors and Element Binding Help
16
demo The View
17
Evolving Pattern MVVM is Still Growing
Some Frameworks Support it (e.g. Prism) Philosophy of Specifics is not settled View-Centric ViewModel-Centric Marriage/Mediator No Completely Right/Wrong Way to Implement It Patterns Only Good If They Help
18
Frameworks I Hand-Coded MVVM Frameworks Help
Laurent Bugnion’s Light MVVM Nikhilk Kothari’s FX Framework Michael Sync’s Silverlight MVVM Toolkit
19
question & answer
20
Resources www.microsoft.com/teched www.microsoft.com/learning
Sessions On-Demand & Community Microsoft Certification & Training Resources Resources for IT Professionals Resources for Developers
21
Complete an evaluation on CommNet and enter to win an Xbox 360 Elite!
22
Required Slide © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.