Can anyone explain what a Spring Framework bean is?

Asked

Viewed 1,598 times

0

Can anyone simplify what a bean is ? I’ve read the description by the Spring site itself but it didn’t make much sense (to me) what it actually is, and what it actually serves.

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

Hugs and thanks in advance. rs

1 answer

1

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 in the container (spring application) through statements in xml (in your case, spring-context.xml) or through annotation, thus using the control inversion pattern (Ioc - Inversion of Control). I don’t know if you understand. Big hug.

For further information, see Inversion of Control (In English).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.