• 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

Auto wiring Vs explicit wiring

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ,

Can you please clarify in details what is the difference between auto wiring and explicit (manual) wiring - with samples.

Thanks in advance.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I recommend obtaining a copy of Manning's "Spring in Action" book.

Explicit wiring, as its name implies, requires the target bean to be mapped with an explicit property name/value pair for Spring to use to link the two objects.

Autowiring is based on the idea that you indicate what properties are to be autowired and Spring deduces its corresponding value. For example, I name a bean "bar", and in my bean "foo", I have an autowired "bar" property. Spring looks in its inventory for an object with name "bar" and invokes foo's "setBar()" method supplying the "bar" object.
 
Everybody's invited. Even this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic