Tuesday, April 22, 2014

Prism 5.0 for WPF

I was listening to .Net Rock's! show 971 with Brian Noyes, and I was thrilled to hear that Microsoft just dropped a new release of Prism - Prism 5.0 for WPF. I've been using Prism on an application mainly for modularity, but I was encouraged to hear that several small tweaks had been made to the Prism library.  Here are a few of the highlights...
  • Broken into smaller more targeted assemblies
  • Updated NotificationObject to BindableBase
  • Includes a conventions based View-Model Locator
  • Objects can be used to pass data around in Region navigation
Personally, I think this is all great!  I was a little shocked to read some of the comments on CodePlex.  People in general, and developers especially, have a tendency to develop very strong opinions based on biases from their personal experiences.  Let's not lose site of the reason we have the MVVM pattern. Its about the ability to decouple the software so we can test it.  If you use an injected view service to open child windows or a behavior, and you accomplish the goal of keeping your View-Model testable... does it really matter?  
There was one comment aimed at the View-Model Locater calling it an anti pattern...  People are entitled to their opinions, so here is mine.  Using the View-Model locater that now comes with Prism saves me a few lines of code.  Relating the View to the View-Model is ceremony code. If it doesn't drive business forward, it wastes my time.  Some clever people at Microsoft helped me out with this...  My View-Model is still testable and the project has a few less lines of my code. What's wrong with that?

The guidance documents have been updated, and the source is on CodePlex

No comments:

Post a Comment