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.?