View Poll Results: Which Dependency Injection annotation do you favor?

Voters
132. You may not vote on this poll
  • @Inject

    30 22.73%
  • @Autowired

    85 64.39%
  • I don't use either.

    17 12.88%
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Thread: Which Dependency Injection annotation do you favor?

  1. #11
    Join Date
    Jul 2009
    Posts
    16

    Default

    @Resource is even better ! JEE5 compliant and Spring non intrusive code .

  2. #12
    Join Date
    Feb 2011
    Posts
    9

    Default

    I prefer @Autowired

  3. #13

    Default I am a @Autowired Fan!

    Autowired has always worked for me, it's clean, simple, and does exactly what I need it to.

    Paul

    Find Spring Consultants at java316.com

  4. #14
    Join Date
    Nov 2006
    Location
    Boston, MA
    Posts
    303

    Default @Atutowired

    @Autowired can be configured to NOT require the injection, therefore it is more functional and flexible than @Inject. So, I always use @Autowired, and I am not concerned about being tied to Spring... C'mon people, are you serious?

  5. #15

    Default

    Autowiring is fine up to a point:
    • where contexts are small, self-contained and isolated
    • when starting out and wanting to take defaults


    However, with large systems with lots of config where you have to do things like re-use resources or use classpath* and/or imports then you can lose control of what's going on. As soon as you have to start using qualifiers you're going against the grain of autowiring anyway.

    Admittedly, the above situations speak of poor layout, design and control of configuration. The config can and does get this way very quickly.

    Autowiring does a good job and I'm often tempted to use it but when it breaks it's tough to sort out whereas being explicit rarely has these problems.

  6. #16
    Join Date
    Apr 2011
    Posts
    5

    Default

    i prefer @Inject i have used it for a long time

    Paul

  7. #17
    Join Date
    Apr 2011
    Posts
    5

    Default

    I voted for @Autowired

    Julia

  8. #18
    Join Date
    Aug 2008
    Location
    St Louis, MO
    Posts
    51

    Default

    @Resource seems to be better & JSR compliant

  9. #19
    Join Date
    Jul 2008
    Location
    France
    Posts
    18

    Cool

    1. @Resource
    2. @Autowired couple with Qualifier (sometimes . )

  10. #20
    Join Date
    May 2011
    Posts
    5

    Default

    i voted also.

    gar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •