Mastering Ninject for Dependency Injection
上QQ阅读APP看书,第一时间看更新

Chapter 1. Understanding Dependency Injection

"It's more about a way of thinking and designing code than it is about tools and techniques"

– Mark Seemann

This chapter introduces the Dependency Injection (DI) concepts and describes the advantages of using this pattern. We will also go through a simple example and implement the principles and patterns related to the DI technique to it. After understanding what a DI container is, we will discuss why Ninject is a suitable one.

By the end of this chapter, the reader is expected to have a good understanding of DI and how Ninject can help them as a DI container.

The topics covered in this chapter are:

  • What is Dependency Injection?
  • How can DI help?
  • My first DI application
  • DI Containers
  • Why use Ninject?