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.

Date :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.

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

good short description

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

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


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

Simple and easy to understand

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

Very Nice, accurate answer.

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

sweet and short description

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


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

Very nice Answer! Short but sweet

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

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

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

Thanks for keeping it very short yet clear.

Date :12/09/15 08:36:32,        By :junaid

Boss ur super... very easy to explain i am reffered so many sites but i am not found this much of easy answer. ur the genius

Date :28/08/15 04:29:33,        By :jammulaiah

Post Answer

  Captcha code
Enter Above Code: