【问题标题】:Equivalent of @ImplementedBy in Spring相当于 Spring 中的 @ImplementedBy
【发布时间】:2013-05-09 11:36:04
【问题描述】:

Spring DI 中 Guice 的 @ImplementedBy 注解等价于什么? (我用谷歌搜索但没有结果。)

【问题讨论】:

    标签: spring dependency-injection guice


    【解决方案1】:

    Spring 中不存在 JIT 默认绑定。您只能将一个实现设置为依赖项,或者使用命名限定符 @Named 或 @Qualifier 注释来指定实现,但这是静态绑定(不等同于 @ImplementedBy Guice 实现)。

    我创建了一个启用 jit 绑定的 spring 扩展。这个库将 @ImplementedBy 注释添加到 Spring。请参阅https://github.com/devacfr/spring-implementedby 并给我反馈

    【讨论】:

      【解决方案2】:

      【讨论】:

      猜你喜欢
      • 2014-03-19
      • 1970-01-01
      • 2021-04-03
      • 1970-01-01
      • 2021-11-07
      • 2014-07-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多