Tagged articles
FactoryBean
18 articles · Page 1 of 1
Spring Boot 3.5 introduces the BeanFactoryInitializer extension point, allowing developers to safely pre‑instantiate specific beans before the regular singleton pool, replace unsafe BeanFactoryPostProcessor hacks, fetch remote configurations, and programmatically register @Tool‑annotated beans, all demonstrated with concrete code examples and a working test.
BeanFactoryInitializerFactoryBeanJava
0 likes · 8 min read

This article explains the distinction between Spring's BeanFactory and FactoryBean, covering their roles, core APIs, typical implementations, key differences in registration and retrieval, classic use cases, common pitfalls, and frequent interview follow‑up questions, with concrete code examples and comparison tables.
BeanFactoryFactoryBeanInterview
0 likes · 10 min read

The article demonstrates four practical techniques—@Qualifier, manual ApplicationContext lookup, Map injection, and a FactoryBean with dynamic proxy—to dynamically select among multiple Spring Boot beans, eliminating static if‑else wiring and improving code flexibility and maintainability.
@QualifierApplicationContextFactoryBean
0 likes · 7 min read

This article explains the distinct roles of Spring's BeanFactory and FactoryBean, compares their functionalities, outlines how to retrieve beans and FactoryBeans, and provides practical code examples and usage scenarios for creating complex objects within the Spring IoC container.
BeanFactoryFactoryBeanIoC
0 likes · 8 min read

This article explains the operation of the Spring IoC container, the DIP principle, dependency injection, XML bean definitions, custom and static factories, FactoryBean usage, bean scopes (singleton and prototype), and demonstrates their behavior with Java code examples.
Bean ScopeFactoryBeanSpring
0 likes · 6 min read

The article compares Spring's BeanDefinition and FactoryBean mechanisms, detailing their roles, how they are defined via XML, annotations or interfaces, the use of BeanDefinition.setInstanceSupplier() for flexible instantiation, and provides concrete code examples for each approach.
BeanDefinitionFactoryBeanJava
0 likes · 6 min read

Spring Boot can emulate SPI plug‑in extensions by using native Java ServiceLoader, conditional bean registration with @ConditionalOnClass/@ConditionalOnProperty, custom FactoryBean implementations, or programmatic BeanDefinitionRegistryPostProcessor registration, each enabling dynamic service loading based on configuration or runtime conditions.
FactoryBeanJavaSPI
0 likes · 7 min read

This article explores why a custom Advisor aspect may not work in Spring Boot 3.2, demonstrates how enabling @EnableAspectJAutoProxy and adjusting bean roles resolves the issue, and also covers advanced topics such as FactoryBean type conversion, version retrieval, SpringProperties, and the Spring SPI mechanism.
AdvisorFactoryBeanSpring Boot
0 likes · 8 min read

This article explains Spring's FactoryBean interface, detailing its three core methods, and provides step‑by‑step examples—including a simple bean, prototype scope, proxy creation, accessing the original FactoryBean, and using ServiceFactoryBean for SPI—illustrating how to customize bean instantiation in Spring 6.
FactoryBeanSPIdependency-injection
0 likes · 7 min read

This article explains how Spring’s FactoryBean mechanism enables seamless integration with MyBatis by detailing the roles of BeanFactory, SqlSessionFactoryBean, MapperScannerConfigurer, and MapperFactoryBean, and provides annotated code examples and XML configuration to illustrate the underlying process and its benefits for transaction management and thread safety.
FactoryBeanJavaMyBatis
0 likes · 13 min read

This article explains the differences between Spring's ObjectFactory and FactoryBean interfaces, shows how they are applied in bean creation, servlet API injection, and custom implementations, and provides code examples and best‑practice tips for resolving bean ambiguities in a Spring backend.
FactoryBeanJavaObjectFactory
0 likes · 10 min read

This article provides a comprehensive guide to Spring’s extension mechanisms, covering FactoryBean, @Import, bean lifecycle callbacks, BeanPostProcessor, BeanFactoryPostProcessor, the SPI system, Spring Boot startup hooks, event publishing, and custom XML namespaces, complete with runnable code examples and diagrams.
BeanPostProcessorEventFactoryBean
0 likes · 37 min read

This article explains five different techniques for adding beans to the Spring IoC container—including @Configuration + @Bean, @ComponentScan, @Import with various selectors, FactoryBean, and BeanDefinitionRegistryPostProcessor—providing complete code examples and practical usage notes for developers.
@BeanConfigurationFactoryBean
0 likes · 10 min read

Explore multiple Spring bean injection techniques—including XML configuration, annotation-driven @Configuration/@Bean, @Import, FactoryBean, and BeanDefinitionRegistryPostProcessor—through clear explanations, code samples, and practical examples, highlighting their advantages, drawbacks, and how to integrate them into a Spring application.
BeanDefinitionRegistryPostProcessorFactoryBeanJava
0 likes · 10 min read

This article presents a design pattern for a unified, annotation‑driven HTTP client in a Spring‑based payment system, detailing custom annotations, dynamic proxy enhancement, and bean registration via FactoryBean and ImportBeanDefinitionRegistrar, with complete code examples and a summary of key concepts.
AnnotationsFactoryBeanHTTP Client
0 likes · 16 min read

This article explains the differences between Spring’s ObjectFactory and FactoryBean interfaces, demonstrates how they are used internally for bean creation, dependency injection, and servlet API injection, and shows how to customize ObjectFactory behavior to resolve bean conflicts and inject specific implementations.
FactoryBeanJavaObjectFactory
0 likes · 9 min read

This article explains the roles of BeanFactory and ApplicationContext in Spring, compares BeanFactory with FactoryBean, and provides detailed code examples showing how to configure and retrieve beans, including custom FactoryBean implementations and the use of '&' to access the FactoryBean itself.
BackendBeanFactoryFactoryBean
0 likes · 16 min read

This article provides an in‑depth exploration of Spring's core concepts—including the IOC container, ApplicationContext vs BeanFactory, bean instantiation lifecycles, and the role of FactoryBean—supplemented with diagrams and source code excerpts to help Java developers understand the framework's inner workings.
BackendBeanFactoryFactoryBean
0 likes · 16 min read
