This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Spring and the fly likes how come we are able to achieve Spring IOC without SpirngIOC.jar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "how come we are able to achieve Spring IOC without SpirngIOC.jar" Watch "how come we are able to achieve Spring IOC without SpirngIOC.jar" New topic
Author

how come we are able to achieve Spring IOC without SpirngIOC.jar

Monica. Shiralkar
Ranch Hand

Joined: Jul 07, 2012
Posts: 541
Spring IOC is used to remove the tight coupling by avoiding object creation inside a class and instead doing it from bean.For ths we would require Spring IOC Jar.

Now I have a doubt...

Suppose we dont use Spring IOC jar ..we use only Spring.jar and use ClassPathResource and XMLBeanFactory we are still accomplising the same thing...

suppose there is a hello bean
hello.xml

<beans>
<bean id="hello" class=HelloImpl


<property name="greeting"


</beans>

Resource res=new classPathResource("hello.xml")
Beanfactory factory=new xmlBeanFactory(res)
Hello bean1=(Hello) factory.getBean("hello")

bean1.sayHello("Tom")


Class HelloImpl
{
public sayHello(String temp)

}




Now are we not accomplising the same thing as Spring IOC without using Spring IOC Jar...?


we are getting the SayHello objects not inside Class but using Bean.Is this not same we achieve in Spring IOC...?

If so then how are we able to achieve the same without using SpringIOC jar.?




Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1632
    
    7

Please UseCodeTags

I am sorry but I really don't understand your question. Spring IOC JAR and Spring JAR? What is it you are trying to accomplish what version of Spring are you using? Is this a stand alone app or a web app?


[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how come we are able to achieve Spring IOC without SpirngIOC.jar
 
Similar Threads
error in a simple hibernate application
Spring aware servlets
how to solve NoClassDefFoundError while creating XmlBeanFactory object in springs?
very new to spring. Need help in this small spring program
problem in my Spring Application program