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?

What is ...

Get Mastering Ninject for Dependency Injection now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.