I am definitely a minority on this, but I tend to agree with @Shnitzel. MVVMs and bindings that go hand in hand with it are great ideas, but they are poorly served by current MS tools. The syntax for all but the simplest bindings is very difficult to get right, and it is greatly complicated by the fact that WPF and Silverlight silently swallowed all the errors. (Yes, some errors appear in the debug window, but they are not enough, and without sufficient detail.) You can use hacks, such as writing a debug value converter, but the fact remains: the toolbox is still quite immature. (And here is my standard complaint that data binding is not strongly typed, which means that tools CANNOT catch errors for you.)
I hear everyone when they insist on testability, and I'm a big fan of automated testing. But, at least with the current state of our toolkit, improved MVVM testability comes at a pretty high price.
Consider this scenario: you have a large application with 50+ forms / pages, and you just got into a big refactoring of your model and ViewModel. In this process, you renamed a bunch of classes and properties, etc. Now find all the places in your XAML that you need to change to display the new class and property names. So much to test, huh? Not only will the IDE not catch your binding errors, the compiler will not catch them, and most importantly, the application will not even throw an error at runtime. You need to get a tester to run the entire application, and make sure all your bindings are still doing what you want them to do. Ugggh. Ugly and painful. At least when I did everything the old way, the compiler will tell me when I messed up something.
Returning to my cave, to avoid slings, arrows quickly headed towards my path ...
[Edit 12/10/2010 - MS recently announced that SL5 will be able to debug data bindings , including the ability to set breakpoints on them so you can see what is happening. This is a big step in the right direction. It still does not fix what I see as a fundamental problem, that data binding does not have compilation type validation, but it does slightly improve the usefulness of the toolbox.]
Ken smith
source share