What are inner beans in Spring?
What are inner beans in Spring?
Inner beans in Spring are beans that are defined within the scope of another bean, essentially serving as a property of the enclosing bean. They are typically used when a bean is only required for one particular property and nowhere else in the application. Inner beans are declared inside the <property> or <constructor-arg> tags of a bean definition in the Spring XML configuration file. They are always anonymous and scoped as prototypes, meaning they are created anew each time they are injected into the enclosing bean.
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.