aspose file tools*
The moose likes Spring and the fly likes What's the difference between 'Inversion of control' and 'Dependency injection'? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "What Watch "What New topic
Author

What's the difference between 'Inversion of control' and 'Dependency injection'?

Rogerio Kioshi
Ranch Hand

Joined: Apr 12, 2005
Posts: 689
Hi,

Are these two terms synonims? If not, what's the difference between both?

Thank you


SCEA 5 (part 1), SCBCD, SCWCD, SCJP, CLP, CLS
SampathKumar chinnadurai
Ranch Hand

Joined: Jul 05, 2006
Posts: 44
Check this linkSpring IOC


Cleared SCJP 6 (87%), SCWCD 5 (94%), SCBCD 5.0(95%), PMP ,preparing SCDJWS ,OCUP
Kevin Cho
Greenhorn

Joined: Nov 12, 2008
Posts: 20
Just going w/ what someone said to me.

IoC = You give the control to the container to get instance of objects. So instead of you doing "new", let the container do that for you.
DI = The act of "wiring" properties to an object.



Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17257
    
    6

They are synonymous in my mind. With a little added distinction that Kevin pointed out. So IoC also includes injecting dependencies. But DI is just DI not "new" where IoC includes new and DI.


Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Rajesh Rajamanickam
Greenhorn

Joined: Aug 10, 2011
Posts: 2

Inversion of control is a general concept to achieve/implement that we use

Dependency injection in spring.

-Rajesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What's the difference between 'Inversion of control' and 'Dependency injection'?