![Hands-On High Performance with Spring 5](https://wfqqreader-1252317822.image.myqcloud.com/cover/793/36699793/b_36699793.jpg)
上QQ阅读APP看书,第一时间看更新
Advantages of the setter-based DI
The following are the advantages of the setter-based DI in your Spring application:
- It's more readable than the constructor injection.
- This is useful for non-mandatory dependencies.
- It solves the circular dependency problem in the application.
- It helps us to inject the dependency only when it is required.
- It's possible to reinject dependencies. It is not possible in a constructor-based injection.