![Hands-On High Performance with Spring 5](https://wfqqreader-1252317822.image.myqcloud.com/cover/793/36699793/b_36699793.jpg)
上QQ阅读APP看书,第一时间看更新
Disadvantages of the setter-based DI
Although the setter-based DI has higher priority than the constructor-based DI, the following are the disadvantages of the former:
- There is no guarantee in a setter-based DI that the dependency will be injected.
- One can use a setter-based DI to override another dependency. This can cause security issues in a Spring application.