MVVM, Unity, Prism, MEF, Caliburn – What should I use?

If you want to build an MVVM application (which you probably do for various advantages), then you want an MVVM framework.

I would recommend Caliburn.Micro, as it is straightforward to implement following the examples on the Caliburn.Micro documentation page. It also has a very compelling convention over configuration mechanism, and uses an Actions system to invoking verbs (methods) on your view models from the view. This is more powerful than any other mechanism I’ve seen.

Prism is quite a heavyweight framework which includes elements of MVVM design to help the implementation, as well as being particularly tailored towards building composite applications (applications that are built up of decoupled components within a hosting shell).

MEF is useful for these types of applications that need to discover plugins or extensions to the application (even after the application has bootstrapped), and can be used alongside an MVVM framework such as Caliburn.Micro. MEF can also be used for implementing inversion of control, but doesn’t provide some of the core features found in other inversion of control containers, so you may decide to only use it to implement plugin functionality.

Unity is an IoC container, and would be used to implement dependency injection for your general application infrastructure. There are lots of IoC containers in the .NET space though, some of which offer either improved performance, additional features, or a more friendly API.

I don’t know about ReactiveUI as I haven’t used it.

If you’re talking about maximising code reuse for a move to WinRT, then MVVM is a great choice.

Leave a Comment