WPF MVVM – Is MVVM the Right Choice for Single-Developer Projects?

mvvmwpf

I'm starting to design and develop a WPF application for my company and one of the first choices that I have to make is whether or not to use MVVM.

The main points to consider are:

  • The application is basically a VisualStudio-like editor, where designers will create projects and will define UIs by dragging and dropping UI elements on a canvas
  • I will be the only designer and developer of such application
  • The project could last many months (from 4 to more than 12, depending on the features they will choose to add during the development)
  • Last, but not the least, I have a very basic and "young" knowledge of the MVVM pattern and of its relative frameworks (I just developed a little test application with MVVM Light, including RelayCommands and ModelViewLocator).

What should I do? Is MVVM worth it or is it just an overkill for a solo project? Is there something newer that could be helpful also for the future (e.g. I read something about ReactiveUI, but I know nothing about how it works) or have I to continue with the good old MVC?

Thank you very much for your help!

Best Answer

I'm a big fan of MVVM. The simple reason is I can change my UI and change frameworks any time I want. This is great, but in order to achieve full decoupling that will benefit in longer term, you should also think about implementing Depedency Injection.

What I found annoying about using MVVM is communication between ViewModels. That's where additional frameworks really can help out. You should look into using Prism or Caliburn.Micro. They allow you to use EventAggregators, IoC containers, guards and many more. With that they make Dependency Injection and communication between ViewModels easy.

MVVM will definitely help you solve many problems, but not all frameworks support MVVM. This means that you should do a little research and find what frameworks you would like to implement in the future and see if they are easy to implement using MVVM.

At first MVVM may seem irritating, but if you will strictly follow its rules you'll have a very easy to test and improve application. You will definitely need to test your application and with decoupled UI and Dependency Injection it will be much much easier.