What is Inversion of Control?

Showing Answers 1 - 27 of 27 Answers

Shailendra Tiwari

  • Jul 5th, 2007
 

IOC container is used in Spring for making bean object by application context.xml. 

  Was this answer useful?  Yes

Sachin Kumar

  • Sep 4th, 2007
 

IOC term is coined by Martin Flower for describing a pattern where direct coupling between objects can be reduced by using service locator kind of architecture which is getting exploited in spring by what is called dependency Injection, which says that classes don't need to call another implementaion class and bind to that only rather container will injected dependent objects of declared interface resolved  at startup or by lazy loading at request time.

  Was this answer useful?  Yes

mohammad osman

  • Sep 8th, 2007
 

Inversion of control is based on the phenomenon that says, when ever dependency betwen two classes (say class A and class B) now if A needs to access the methods of B, then following our traditional approach we go ahead and create and object of B in A, but as the fact of matter, B is there to serve A not A serving B creating objects for B , So in IOC the the the class B will try to inject its object into A rather than A creating object of B. so the control is reversed , during the run time now spring container takes care which class object to inject into other class.

Osman.

mindfreek

  • Nov 8th, 2007
 

Inversion of control or IOC is just a term.  This term is used  in spring framework for its dependency injection. Its all about this much , While your applications starts  it will create the Objects of the Classes listed in application-servlet.xml file and serve that Objects to the  classes which calling it through setter method, constructor,normal method. So that you don't need to create an Object of a class by yourself in that class.

Holywood principle "Don't call me , I will call you"  

IOC Container concept

org.springframework.beans
||
||--->|The BeanFactory interface advanced configuration mechanism capable of managing objects of any nature.
        ||
        ||
org.springframework.beans.factory.BeanFactory
            
||
             ||-->|BeanFactory is the actual representation of the Spring IoC  container that is responsible for containing and otherwise managing bean

XmlBeanFactory implementation BeanFactory

XML configuration metadata +Business object =appplication (interdependencies between such objects)

  Was this answer useful?  Yes

sampra

  • Apr 3rd, 2012
 

Inversion of control or IOC is just a term. This term is used in spring framework for its dependency injection. Its all about this much , While your applications starts it will create the Objects of the Classes listed in application-servlet.xml file and serve that Objects to the classes which calling it through setter method, contructor,normal method. So that you don't need to create an Object of a class by yourself in that class.

Holywood principle "Dont call me , I will call you"

  Was this answer useful?  Yes

sivasankar reddy lakku

  • Aug 18th, 2012
 

IOC is InversionOfControl(dependecyINjection).i.e advantage of springs,very good concept.It will automatically create the instances of the classes that we have written for business logic through BeanFactory...(It does not allow you to create the object, we have to describe how they would be created

  Was this answer useful?  Yes

Gnaneshwar M

  • Sep 21st, 2012
 

IOC means inversion of control, which is a principle also known as Dependency Injection. It is the process where every object defines their dependency with whom they work within a Configuration file.These dependency object injected through constructor arguments or method parameters or factory methods. The container injects the declared dependencies while creating the beans. As the process is inverse where the bean is not acquiring the dependency object rather the container is pushing the dependencies hence it is called "Inversion of Control".

  Was this answer useful?  Yes

baba

  • Jun 16th, 2016
 

Inversion of Control is full form of IOC.
It is used to collaborating the objects and maintains life cycle of beans within the IOC you can configure the scope of the beans also, by default every bean scope is singleton.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions