Model-View-ViewModel (MVVM) is a client-side design pattern. It guides the structure and design of your code to help you achieve “Separation of Concerns.” Implementing MVVM requires a bit of a mind-shift in the way you think about the functionality of your application. It has a significant learning curve and requires some additional upfront effort to get started on the right path. But the benefits are significant:
- Your code is easier to understand, maintain and troubleshoot.
- You are much more productive when you leverage the frameworks’ (WPF, Silverlight, XAML, WinRT) built-in features like Data Binding, Resource Dictionaries, Dependency Properties, Routed Events, Commands, etc.
- You can test your app’s behavior “under-the-skin,” avoiding the pitfalls and cost of testing at the UI level.
- Your ViewModels afford testability. You can have unit test coverage allowing “Test-Driven-Development” and “Automated Regressions.”
- Decoupling the View from the ViewModel in the way enabled by MVVM allows designers and developers to work productively in harmony.