WCF, MVVM and good client design

Posted by Marcus Hammarberg on May 11, 2010
Stats

Up to now most of my assignments has not been client-related. Often the project description and main focus is on the layers beneath the GUI. But lately I have seen a shift in the industry and more so in my own interest. Client-side stuff is coming on strong.

And it’s hard work to design a well structured client application. There are a lot of patterns but the frameworks and “recommended” ways up to now often doesn’t lend themselves well to those patterns. Ever tried to do proper MVC with WebForms or WinForms – it’s not easy.

But that has also shifted. I have written a lot on ASP.NET MVC – that of course supports the mother of all client patterns, MVC, in a great way. So enough said there.

But for “fat clients” such as windows clients there’s been a hazy mystery for me. I know OF WPF but I don’t know WPF. And they seems to talk a lot about the MVVM (Model-View-ViewModel) pattern.

To the extent of my knowledge now the MVVM pattern is an adaptation of Martin Fowlers Presentation Model pattern. An adaptation that make full use of the WPF DataBinding capabilities.

I’ve found some great resources on this – starting with this excellent presentation on the pattern, by Jason Dolinger. Here is his source code

After that I thought that there must be frameworks that helps me with this. And there are. About as many as there are WPF developers… Here is a great StackOverflow post that helps you choose one.

And following one of those links (to the MVVM Foundation) I finally found and read this great MSDN Magazine article by Josh Smith.



Published by Marcus Hammarberg on Last updated