Skip to content

Commit bb6b7ba

Browse files
authored
Update readme.md
1 parent dfa6e04 commit bb6b7ba

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Choosing from Multiple Bean Implementations in Spring Boot
2+
3+
If you have multiple implementations of the same interface, Spring needs to know which bean to inject into a class.
4+
5+
In this article, we will explore what are the different approaches to injecting beans conditionally when you have multiple implantation of a component or service.
6+
7+
- [Option-1: Using @Primary Bean Annotation](https://stacktips.com/articles/choose-from-multiple-bean-types-springboot#option-1-using-primary-bean-annotation)
8+
- [Option-2: Autowiring using @Qualifier](https://stacktips.com/articles/choose-from-multiple-bean-types-springboot#option-2-autowiring-using-qualifier)
9+
- [Option-3: Using ApplicationContext to Dynamically Select Beans](https://stacktips.com/articles/choose-from-multiple-bean-types-springboot#option-3-using-applicationcontext-to-dynamically-select-beans)
10+
- [Option-4: Custom Annotation and Bean Factory](https://stacktips.com/articles/choose-from-multiple-bean-types-springboot#option-4-custom-annotation-and-bean-factory)
11+
- [Option-5: Bean Selection Using Custom Conditions](https://stacktips.com/articles/choose-from-multiple-bean-types-springboot#option-5-bean-selection-using-custom-conditions)
12+
13+
### Related topics:
14+
15+
* [#spring-boot](https://stacktips.com/topics/spring-boot)
16+
* [#android](https://stacktips.com/topics/android)
17+
* [#java](https://stacktips.com/topics/java)
18+
* [#python](https://stacktips.com/topics/python)
19+
* [#spring](https://stacktips.com/topics/spring)
20+
* [#design-pattern](https://stacktips.com/topics/design-pattern)
21+
* [#git](https://stacktips.com/topics/git)
22+
* [#maven](https://stacktips.com/topics/maven)

0 commit comments

Comments
 (0)