Junior — Middle
Explain what is meant by a bean within the Spring context?
sobes.tech AI
Answer from AI
In the context of Spring, the term "bean" refers to an object managed by the Spring container. It is a component of the application that is created, configured, and managed by the Spring IoC container. Beans are usually described in configuration files or using annotations.
Example: a service class annotated with @Service becomes a bean that can be injected into other components via dependency.
Thus, a bean is a fundamental building block of a Spring application, providing inversion of control and facilitating dependency management.