You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 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)
0 commit comments