You are previewing Dependency Injection in .NET.

Dependency Injection in .NET

Cover of Dependency Injection in .NET by Mark Seemann Published by Manning Publications

Chapter 14. Unity


  • Introducing Unity
  • Managing lifetime
  • Working with multiple components
  • Configuring difficult APIs

In the previous chapter, we looked at Autofac, which is one of the more recent DI CONTAINERS to enter the game. Another contemporary DI CONTAINER is Unity, which we’ll examine in this chapter.

Autofac can be labeled as a second-generation DI CONTAINER because it was conceived and developed directly on .NET 3.5 without any legacy baggage from earlier versions of .NET. Although Unity appeared in roughly the same time frame, it took a more conservative approach. Unity 1.0 was released in May 2008, but targeted .NET 2.0, acknowledging that many development organizations would take their time before upgrading to .NET 3.5. ...

The best content for your career. Discover unlimited learning on demand for around $1/day.