• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dependency Injection

 
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Autowired / @Resource / @Inject using these spring annotations we can inject the dependencies into spring bean. All three annontations does same thing. Is there any difference ?
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are some, I typically use @Autowired in my applications because I have no intention of moving away from Spring. Of course I still need @Resource for wiring in Collections(of non spring beans) as @Autowired handles this differently. However the main differences come down to name vs type. Whatever approach you choose just stay consistent throughout the application.

Here is a more detailed look at it.
http://blogs.sourceallies.com/2011/08/spring-injection-with-resource-and-autowired/
 
reply
    Bookmark Topic Watch Topic
  • New Topic