Tag

Bean Overriding

0 views collected around this technical thread.

Selected Java Interview Questions
Selected Java Interview Questions
Apr 18, 2024 · Backend Development

Understanding @Configuration vs @Component Bean Overriding in Spring Boot 2.0.3

This article explains why a Spring Boot 2.0.3 application creates two UserManager beans when both @Configuration + @Bean and @Component are used, how the container decides which instance is injected, and how newer Spring versions allow developers to control bean‑definition overriding via configuration.

Backend DevelopmentBean OverridingConfiguration
0 likes · 8 min read
Understanding @Configuration vs @Component Bean Overriding in Spring Boot 2.0.3
Java Architect Essentials
Java Architect Essentials
Jul 10, 2022 · Backend Development

Why @Configuration + @Bean Overrides @Component in Spring Boot and How Bean Definition Overriding Evolved

This article explains why, in Spring Boot 2.0.3, a bean defined with @Configuration + @Bean replaces a @Component‑annotated bean of the same type, shows how to verify which bean is instantiated, and describes the framework’s evolution—including the allowBeanDefinitionOverriding setting—that gives developers control over bean overriding behavior.

BeanBean OverridingConfiguration
0 likes · 7 min read
Why @Configuration + @Bean Overrides @Component in Spring Boot and How Bean Definition Overriding Evolved