This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Rogerio Kioshi
Ranch Hand
Posts: 690
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

Thank you
 
SampathKumar chinnadurai
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this linkSpring IOC
 
Kevin Cho
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Rajesh Rajamanickam
Greenhorn
Posts: 2
Java Oracle Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inversion of control is a general concept to achieve/implement that we use

Dependency injection in spring.

-Rajesh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic