What is a Spring Bean?

A "Spring Bean" is simply a Java object.
When Java objects are created by the Spring Container, then Spring refers to them as "Spring Beans".
Spring Beans are created from normal Java classes .... just like Java objects.

From Spring Documentation

In Spring, the objects that form the backbone of your application and that are managed by the Spring IoC container are called beans. A bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container. Otherwise, a bean is simply one of many objects in your application. Beans, and the dependencies among them, are reflected in the configuration metadata used by a container.

Read more about Spring beans at https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-introduction.

In the early days, there was a term called "Java Beans". Spring Beans have a similar concept but Spring Beans do not follow all of the rigorous requirements of Java Beans.

In summary, whenever you see "Spring Bean", just think Java object.

References

https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#beans-introduction

Comments