Hi Community,
I have these question that came up in my team discussion. I wanted to gather community's feedback on these points. (Legend: V: View, VM: ViewModel, M: Model, IM: interface for ViewModel, INPC: INotifyPropertyChanged)
1. Should VM be agnostic of M?
2. Are V and VM tightly coupled when we say V expects a set of properties from VM?
3. Is it fine to pass M or(IM) inside VM constructor, so that in dual target scenario an M for Desktop can be replaced with that M of silverlight without changing VM?
4. Is it fine to assume that in dual target environment we are more likely to have different M for Desktop and silverlight? Or should we strive to have same M but different VM?
5. Is it correct to always assume that V would be different for Desktop and Silverlight?
6. Is it correct if we strive for a plain VM which just have some properties with getter and setters. And we create an abstraction b/w M and VM lets say A. Our A will listen to changes in M and set the properties in VM. And similarly A will subscribe to INPC of VM, and change the M. In this way we will have a VM which can be used inside Blend. Also our VM will remain same for Desktop and Silverlight so we can package this VM in an independent library(dll). This library will be a public access point. So public API remains same for Desktop and Silverlight.
Please consider that over a period of time many different MVVM concepts have evolved as best practices. So my assumptions below may contradict your's. Please feel free to site some examples as I am very open to change my assumption/opinion.
Thanks in advance :)