• 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

Basic Spring Doubt

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ,
I have following two beans in the xml context. I want to know whether the underlying objects denoted by these 2 beans remains the same or different? In case of String its the same one. What about with spring? Can anybody let me know on this...


<bean id="ftpConnector1"
class="com.service.integ.transport.FtpConnectorCommonsNetImpl">
<property name="ftpUser">
<value>${ftp.provisioning.user}</value>
</property>
<property name="ftpPassword">
<value>${ftp.provisioning.password}</value>
</property>
<property name="ftpServer">
<value>${ftp.provisioning.host}</value>
</property>
</bean>


<bean id="ftpConnector2"
class="com.service.integ.transport.FtpConnectorCommonsNetImpl">
<property name="ftpUser">
<value>${ftp.provisioning.user}</value>
</property>
<property name="ftpPassword">
<value>${ftp.provisioning.password}</value>
</property>
<property name="ftpServer">
<value>${ftp.provisioning.host}</value>
</property>
</bean>

 
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, welcome to JavaRanch!

If you define two beans of the same type, each with the default singleton scope, then two distinct instances of that type will be registered with Spring's IoC container.
It can be a cause of some headaches if you auto-wire your beans by type, though.
Does that answer your question?
 
Dhanesh Rote
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. Got it..
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic