Thursday, 10 September 2015

Migrating to simpleInjector 3.0 with Caliburn Micro Bootstrap changes

A note, Before I write this blog I want to say thanks to all the contributors to the open source libraries those changed the life of developers by preventing writing of Boilerplate code. These libraries are not just helpers but they’re much more efficient than legacy code.
image

Why I’m writing this blog? Well, here’s the reason. I have been a great fan of SimpleInjector because of it’s performance and Caliburn.Micro for being lightweight and faster. I have been using them since the libraries are in their initial version and doing great job till date. Today I spent few hours creating a small application WPF and I was surprised everything was changed. It was whole new world ofcourse if you don’t do practice with coach you gonna miss a lot of stuff.

Let’s look at the changes in simple boootstrapper for WPF application. Since caliburn micro give a nice way to setup a Dependency injection by providing virtual methods in base class BootStrapperBase. Since the changes in SimpleInjector v3.0 for returning list of registered instances which now throws exception if none found. Here’s the complete code snippet for working bootstrap, if it would help someone out there struggling the same problem:

No comments:

Post a Comment