Chapter 3. Meeting Real-world Requirements

This chapter starts with some patterns and antipatterns which should be considered while using Ninject. We will go through the advanced features of Ninject, and also some examples to see how Ninject can meet real-world requirements. By the end of this chapter, the user is expected to know almost all the significant features of Ninject.

The topics covered in this chapter are as follows:

  • DI patterns and antipatterns
  • Multi binding and contextual binding
  • Custom providers
  • Dynamic factories

DI patterns and antipatterns

Dependencies can be injected in a consumer class using different patterns and injecting them into a constructor is just one of them. While there are some patterns that can be followed for injecting ...

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.