Chapter 3. DI Containers

Menu

  • XML configuration
  • Code as configuration
  • AUTO-REGISTRATION
  • COMPOSITION ROOT
  • REGISTER RESOLVE RELEASE

When I was a kid, my mother and I would occasionally make ice cream. This didn’t happen too often, because it required a lot of work and it was hard to get right. In case you’ve never tried making ice cream, figure 3.1 illustrates the process.

Figure 3.1. Making ice cream is an arduous process, with plenty of opportunities for error.

Real ice cream is based on a crème anglaise, which is a light custard made from sugar, egg yolks, and milk or cream. If heated too much, this mixture will curdle. Even if you manage ...

Get Dependency Injection in .NET now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.