Difference between IOC and DI in Spring?

Difference between IOC (Inversion Of Control) and DI (Dependency Injection) in Spring?

30/07/12 05:42:00,        By :Srini


IOC(Inversion Of Controller):   Giving control to the container to get instance of object is called Inversion of Control., means instead of you are creating object using new operator, let the container do that for you.

DI(Dependency Injection):  Way of injecting properties to an object is called Dependency injection.

    We have three types of Dependency injection
        1)  Constructor Injection
        2)  Setter/Getter Injection
        3)  Interface Injection
Spring will support only Constructor Injection and Setter/Getter Injection.

30/07/12 05:43:06,        By :Govanrdan

Hey this is a nice and simplest explanation about these terms. It would be more nice if you also provide some more explanation with a code.

20/02/13 02:13:56,        By :Aditya

good short description

17/04/13 11:39:09,        By :Anil Jee Ojha

More details in youtube now for Difference between IOC and DI in Spring?


12/05/14 09:12:15,        By :Soha s

Simple and easy to understand

17/02/15 11:15:30,        By :Mohan M

Very Nice, accurate answer.

13/05/15 09:30:11,        By :Murali

sweet and short description

12/03/15 06:12:43,        By :Pravin


11/05/15 15:10:43,        By :SUSHIL

Very nice Answer! Short but sweet

15/07/15 08:35:46,        By :Prashant Kamble

Awesome...... Very clearly understood, Nice.......

24/07/15 12:51:31,        By :Anand B

Post Answer
  Captcha code
Enter Above Code: