依赖注入的方式

依赖注入的方式

  1. 构造方法注入
  2. setter注入 (属性注入)
  3. 基于注解的注入
  4. 接口注入
  5. 反射 实现依赖

DI (constructor/setter/property注入 Getter注入)

posted @ 2022-11-08 00:41  jingjingxyk  阅读(24)  评论(0编辑  收藏  举报