Click here to load reader
Upload
johan-lindfors
View
1.032
Download
5
Embed Size (px)
DESCRIPTION
Presentation about the MVVM pattern and some experiences of different MVVM frameworks for Windows Phone 7.
Citation preview
MVVM
Johan Lindfors
model-view-viewmodel
view
viewmodel
model
separation of concerns
• modularity
• loose coupling
• role separation
• tool friendly
• maintainability
• less code
• testability
separation of concerns
• role separation
• tool friendly
• less code
”everybody wants choices,
no one wants to choose”
• role separation
• tool friendly
• less code
+ ++ + -
++ + + -
+ + ++ -
• role separation
• tool friendly
• less code
• coolness
+ ++ + -
++ + + -
+ + ++ -
- + + ++
• modularity
• loose coupling
• role separation
• tool friendly
• maintainability
• less code
• testability
• coolness
- + + ++
- + + ++
+ ++ + -
++ + + -
++ + - +
+ + ++ -
- + + ++
- + + ++
demo
model
• platform independence?
• PortableClassLibrary?
• [DataContract]
view
• xaml
• popups
• animations
• dispatcher
view-model
• encapsulation or incorporation of model?
• instantiation?
1. per view/page in code
2. per view/page in xaml
3. per application instance
4. using view-model-locator
• converters or conversions?
design time
• mock service or view model?
• what about demo time?
using System.ComponentModel; ... if (DesignerProperties.IsInDesignTool) { }
lesson learned
design code
resources
• www.mvvmexplained.com
• caliburnmicro.codeplex.com
• mvvmlight.codeplex.com
• compositewpf.codeplex.com
• programmeramera.se
• www.coderox.se