File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Android Security Essentials Live Lessons this week in the Android 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: 17249
    
    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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What's the difference between 'Inversion of control' and 'Dependency injection'?
 
Similar Threads
Lightweight and heavyweight containers
what's the difference between / and // in Xpath
Google Select
SCJA?
ClassLoader