liveBook · Manning

Dependency injection container

Also called inversion of control container, ioc container, DI container

A dependency injection container is software that constructs or resolves objects and supplies their dependencies according to configured relationships.

How 2 Manning books explain it

ASP.NET Core in Action, 3e

The built-in dependency injection container is the default service container provided by ASP.NET Core for registering and resolving application services.

How it is used
Provides framework and application services to ASP.NET Core components and minimal API handlers.
How deep it goes
Explains registration, dependency graphs, multiple implementations and service lifetimes, then demonstrates replacing the built-in container.
Examples
Uses an email sender dependency graph, a LinkGenerator endpoint and multiple message sender implementations.
What you can do after
Operate and configure the container by registering services, choosing lifetimes and resolving dependencies.

Read how ASP.NET Core in Action, 3e explains dependency injection container →

Spring Start Here, Second Edition

An IoC container creates and connects object instances according to configuration.

How it is used
Manages Spring objects used by dependency injection, transactions, security, and testing.
How deep it goes
Defines beans and compares three registration methods, but does not detail container internals.
Examples
Names @Bean, stereotype annotations such as @Component, and registerBean() as registration options.
What you can do after
Understand how Spring manages beans and the main ways to register them.

Read how Spring Start Here, Second Edition explains dependency injection container →

Also covered in

What to know first

Related concepts

Questions about dependency injection container

What is dependency injection container?

A dependency injection container is software that constructs or resolves objects and supplies their dependencies according to configured relationships.

Which Manning books explain dependency injection container?

ASP.NET Core in Action, 3e and Spring Start Here, Second Edition.

What should I know before learning dependency injection container?

Manning books that teach dependency injection container usually introduce dependency injection first.

What is dependency injection container part of?

Dependency injection container is part of hosting model. A hosting model is the architecture and configuration that determines how an application is started, managed, and exposed by its host environment.

What is dependency injection container also called?

Dependency injection container is also called inversion of control container, ioc container or DI container.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.