1.

What are Spring beans?

Answer»

Bean is used to REFER to any COMPONENT (POJO class) that is created and MANAGED by Spring’s Dependency Injection container. Ideally, a bean should adhere to the JavaBeans specification, but this is not mandatory, especially when using Constructor-based DI to wire the beans together. In general, any Spring-managed resource can be referred to as a bean which acts as the backbone of the application. Beans can be defined either by using XML configuration or by using Annotations like @Component, @SERVICE, @Controller, @Repository on top of the class definition.

A class can access beans either by injecting it directly or by injecting a bean that has defined a dependency on this bean.

The application can use beans without WORRYING about creating or destroying the objects.

BeanFactory is responsible for managing components, including their dependencies as well as their life cycles.



Discussion

No Comment Found