Perhaps I have been doing Flex development with Frameworks like Cairngorm too long but I still don’t get MVVM. I am aware that Cairngorm is a framework and MVVM is a design pattern, but what I am comparing here is Cairngorms implementations of design patterns, mainly the model view controller and the command pattern. Don’t get me wrong, I think the idea of binding a view to a view model is great and the advantages in testability and designer-programmer workflow are great. But there are two things that bother me: one is programming all my actions with Commands, which by the way also bordered me from Cairngorm. Only in Cairngorm the way they implemented the command pattern gave you the benefit of having a centralized controller for all your commands, which you don’t seem to get with MVVM, unless I am missing something. And if I thought implementing the commands in Cairngorm was convoluted in MVVM is much worst, I mean having to create private classes that implement ICommand for everything I do seems like too much. And then you have the problem that not all controls implement commands so for example if you are using a ListBox, which I use a lot, you are out of luck; there are workarounds but all kind of convoluted.
The other thing that bothers me is the communication between View Models. In a standard Model View Controller you collect all you information on a centralized model which is observed by the views, but this doesn’t seem to be the case with MVVM, at least not in the examples that I have seen. So, for example, if you have a control with a list that you use to select an item which is then used as source for different views and consequent actions it is not clear to me how you notify everybody of the changes without a centralized model.
I am aware of MVVMFoundation and the work of Tom Ershamam about WPF Commands Everywhere. Called me old fashioned but I think that in order to really understand a pattern you have to build an application that uses it from scratch. Which is what I am doing, but the whole time I keep thinking I must be missing something essential because I don’t seem to be able to quiet this little voice in my head that keeps telling me there must be a better way.