Spring Framework
  1. Spring Framework
  2. SPR-9836

Injection of beans that implement interfaces with Generics without qualifier annotation

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.2
    • Fix Version/s: Waiting for Triage
    • Component/s: Core:DI
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      I recently had a look at a new Dependency Injection framework called Dagger from Jesse Wilson at Square.

      https://github.com/square/Dagger

      It has two cool features that I wish Spring had as well (will create a separate issue for the other feature). In Spring, when two classes implement the same generified interface, say Repository<T>, Spring cannot find the corresponding injection points (because of type erasure I guess). This requires the developer to add qualifier annotations which makes the code less readable. Dagger is somehow able to determine the injection points without qualifier annotations. It would be great if this feature could be added to Spring.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Thomas Oellrich
            Last updater:
            Chris Beams
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Days since last comment:
              1 year, 30 weeks ago