Thursday, October 7, 2010

Silverlight and MVVM

I've been very heads down lately on a very large .Net project. The project team should be 5 or larger given the scope, but in the spirit of "do more with less", it's just me. Part of the application contains an internal facing UI, which is being done in Silverlight. In an effort to streamline the work I decided to go with the MVVM approach. While MVVM is the "end all be all" rage these days I am encountering a number of problems. First is in the application flow. I am working from screen designs rendered in photo shop by an offsite designer (he's not interested in xaml or learning). These screens tend to be busy and in my opinion very ADD. This makes it extremely difficult to isolate a clean View Model. What I've discovered is that a number of views may need to access the same data so you end up creating a Master View to coordinate the children. Also the no code model in the views is very difficult to achieve when complex interactions are required. I know that I can use Unity or any number of other MVVM frameworks to alleviate some of the issues, but add to the download overhead, which because of the inclusion of third party components is already larger than it need to be.

So while MVVM may be a panacea to some, I see a number of issues with the approach and until the model is built into the framework core it will continue to be a problem.


No comments: