Can anyone explain what a Spring Framework bean is?

Can anyone simplify what is a bean ? I have already read the description on the website of proprio Spring but it did not make much sense (to me) what it is in fact, and what it is for.

I know I have to configure it in spring-context.xml, but I do not know exactly why, or what is happening in reality, I want to understand what need to declare this Bean is supplying.

Hugs and thanks in advance. rs

Author: Sam, 2018-04-11

1 answers

A bean is an object that is created, managed and destroyed by the Spring container, the framework is fully responsible for this object, creating, injecting its properties (Dependency Injection). We can inject this object into the container (Spring application) through declarations in xml (in your case, spring-context.xml) or through annotation, in this way we use the pattern of inversion of Control (IoC - Inversion of Control). I don't know if it's understood. Large hug.

For more information, please refer to Inversion of Control.

 1
Author: Jota Freitas Jr, 2018-04-12 16:30:39