Tech Library
home

Tech Library

Dependency Injection in .NET
Mark Seemann

Cover

Dependency Injection in .NET

Summary

Summary:



Summary

Dependency Injection in .NET presents core DI patterns in plain C#, so you'll fully understand how DI works, covers integration with standard Microsoft technologies like ASP.NET MVC, and teaches you to use DI frameworks like Structure Map, Castle Windsor, and Unity.

About the Technology

Dependency Injection is a great way to reduce tight coupling between software components. Instead of hard-coding dependencies, such as specifying a database driver, you inject a list of services that a component may need. The services are then connected by a third party. This technique enables you to better manage future changes and other complexity in your software.

About this Book

Dependency Injection in .NET introduces DI and provides a practical guide for applying it in .NET applications. The book presents the core patterns in plain C#, so you'll fully understand how DI works. Then you'll learn to integrate DI with standard Microsoft technologies like ASP.NET MVC, and to use DI frameworks like StructureMap, Castle Windsor, and Unity. By the end of the book, you'll be comfortable applying this powerful technique in your everyday .NET development.

This book is written for C# developers. No previous experience with DI or DI frameworks is required.

Purchase includes free PDF, ePub, and Kindle eBooks downloadable at manning.com.

What's Inside

  • Many C#-based examples
  • A catalog of DI patterns and anti-patterns
  • Using both Microsoft and open source DI frameworks

Tabel of Contents

PART 1 PUTTING DEPENDENCY INJECTION ON THE MAP
  1. A Dependency Injection tasting menu
  2. A comprehensive example
  3. DI Containers
PART 2 DI CATALOG
  1. DI patterns
  2. DI anti-patterns
  3. DI refactorings
PART 3 DIY DI
  1. Object Composition
  2. Object Lifetime
  3. Interception
PART 4 DI CONTAINERS
  1. Castle Windsor
  2. StructureMap
  3. Spring.NET
  4. Autofac
  5. Unity
  6. MEF

About the Author

Mark Seemann is a professional software developer and architect living in Copenhagen, Denmark. He has been working with software since 1995 and TDD since 2003, including six years with Microsoft as a consultant, developer and architect. These days he's more into best-of-breed technologies and methodologies such as Continuous Integration, Continuous Delivery, Distributed Version Control Systems, Domain Specific Languages for unit testing and whatever else catches his fancy.