liveBook · Manning

Dependency injection container

As explained in Spring Start Here, Second Edition

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

A dependency injection container manages objects so they can work with framework features. In Spring, these managed objects are called beans, and the Spring context is the IoC container. section 2.5

Spring beans can be added to the context in three ways:

  • Use @Bean for control over object creation, including third-party classes or advanced configurations. section 2.5
  • Use stereotype annotations such as @Component for most application classes, with less boilerplate. section 2.5
  • Register a bean programmatically with registerBean(). section 2.5

How Spring Start Here, Second Edition covers it

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.
How it connects
Connects beans with dependency injection, transactions, security, and testing.

Also explained in

Compare how 2 books explain dependency injection container →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring Start Here, Second Edition. The section links point to the parts of the book it draws on.