Monday, March 16, 2015

Introducing .NET C# Inversion Of Control and Microsoft Unity Hands-On Lab


During past few months we introduced and heavily extended usage of Microsoft Unity IoC container in our code base as a part of the effort to make the code more loosely coupled.

As a result of those changes we now even more than before also rely on Inversion Of Control or more specifically Dependency Injection.

Thus both Microsoft Unity and IoC/DI are now crucial part of our toolbox. In order to bring everybody on our team up-to-speed as well as to have training material for newbies we decided to create a simple training material which should help us.

After brief discussion within the team we agreed that the best way how to handle it would be to:

  • Collect some solid resources describing the IoC/DI.
    • Martin Fowler is obviously first choice - though differences between IoC and DI are better explained in different resources :-).
  • Provide hands-on lab project which will cover all the specifics for:
    • Inversion Of Control/Dependency injection.
    • Microsoft Unity Container.
    • Will serve as a self-training material.
  • We will publish it on Github under MIT license.

Target audience

.NET Software developers/engineers and architects who:

  • Would and are willing to learn about IoC/DI.
  • Are familiar IoC/DI but would learn about Microsoft Unity IoC container.
  • Would learn about possible challenges which usage of the MS Unity can bring.

Training materials

With my colleagues we prepared set of projects which allows everybody to play with all the stuff on reasonably sized projects.

Brief introduction can be found here.

Github projects

If you are either familiar with Github or if you would use this as an opportunity to learn more about it you can just fork/clone repositories below.

Direct access

In the case that you do not like Git/Github you can use direct links below to get the latest version of training projects as well as sample solutions in form of ZIP packages:


If you will find something which needs to be fixed or if you have some interesting sample task just send it as a Github pull request - we accept contributions under MIT license.

Thanks to everybody who already contributed with his time either in form of code or even advice :-).