liveBook · Manning

Spring IoC container

As explained in Spring Start Here, Second Edition

The Spring IoC container creates, configures, and manages Spring application objects and their dependencies.

The Spring IoC container, often called the Spring context, manages application object instances and connects application components with Spring. You make objects known to Spring through configuration, allowing the framework to use them as configured. section 1.2

Spring can control managed objects, including intercepting their methods to add behavior such as error logging. This shifts some control over object creation and method calls from application code to the framework. section 1.2

Where object management helps

An automation test app can use the container to manage instances and keep code maintainable. A desktop app can use it for the same purpose; either kind of app may also use Spring tools to communicate with other systems. section 1.3.2 section 1.3.3

Figure 1.4 Inversion of control. Instead of executing its own code, which makes use of several other dependencies, in an IoC scenario, the app execution is controlled by the dependency. The Spring framework controls an app during its execution. Therefore, Spring implements an IoC scenario of execution.

The diagram contrasts application-controlled execution with execution controlled by a dependency such as Spring. section 1.2

How Spring Start Here, Second Edition covers it

How deep it goes
Defines the container as the Spring context and describes object control and method interception, without setup steps or code.
Examples
Uses object management in automation test and desktop apps, with system communication as a related application need.
What you can do after
Understand how Spring-managed instances can support maintainability in test and desktop applications.
How it connects
Connects inversion of control with the Spring context and Spring AOP method interception.

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.