This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Spring and the fly likes Ioc springconfig.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Spring
Reply Bookmark "Ioc springconfig.xml" Watch "Ioc springconfig.xml" New topic
Author

Ioc springconfig.xml

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

may i when are the objects created through spring.xml (IoC) file are available to use in the parts of application? at runtime?

thanks in advance
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17228
    
    1

When you create the Spring container with ApplicationContext context = new ClassPathXmlApplicationContext("springconfig.xml"), Spring will read in the xml and create instances of your objects and set the dependencies between those objects in that one line of code. After that line of code, all those objects are now available for you to use by getting it out of the applicationContext with a call to getBean(). All that happens at runtime.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

Mark Spritzler wrote:When you create the Spring container with ApplicationContext context = new ClassPathXmlApplicationContext("springconfig.xml"), Spring will read in the xml and create instances of your objects and set the dependencies between those objects in that one line of code. After that line of code, all those objects are now available for you to use by getting it out of the applicationContext with a call to getBean(). All that happens at runtime.

Mark


more than many thanks
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Ioc springconfig.xml
 
Similar Threads
What's the difference between 'Inversion of control' and 'Dependency injection'?
struts vs spring framework
Depengency injection and IOC
DI vs IoC
difference between Dependency Injection (DI) & Inversion of Control (IOC)