Do Spring Beans really mean Objects?

Spring Beans are created from normal Java classes and it is just like java objects.

Photo by Safar Safarov on Unsplash

Java Champions Spring Boot

| Overview

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 and it just like Java objects.

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.

According to the official documentation of Spring.

“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.”

Conclusion:

A spring bean or simply bean is an object that is instantiated, assembled, and otherwise managed by a Spring IoC container.

Next topic: Inversion of Control.

For queries reach out to me at sagar978@gmail.com.

Software Engineer at HCL | Technical Content Writing | Follow me on LinkedIn https://www.linkedin.com/in/sagarkudu/