spring Boot 策略模式的几种实现方案

spring Boot 策略模式的几种实现方案

1.byname 切换bean 的名字

2.@Qualifier 指定Bean

3.有选择的只注入一个bean注释掉某个bean 上的 @Component 注解

4.使用@Primary 

猜你喜欢

转载自www.cnblogs.com/guangzhou11/p/12333166.html