This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Questions about IoC and DI for the Authors of 'Professional Java EE Design Patterns'

 
Greenhorn
Posts: 22
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Murat & Alex,

First i want to congratulate you for your book and wish you a good luck.

My question is regarding the the Inversion of Control (IoC) and Dependency Injection (DI) patterns, could you please explain the difference between them? when learning about Spring i saw that people keep talking about Ioc and Dependecy Injection like if its the same thing! which make me confused if there is any difference betwen them, or if one include the other.

Thanks in advance.
 
Author
Posts: 5
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can find the whole story on the following link http://martinfowler.com/articles/injection.html#InversionOfControl

To cut it short, J2EE heavily depended on JNDI lookups which was definitely cumbersome. Very soon dependency injection became a popular idiom to solve this situation. As far as I know DI was the first term to describe this approach. However, Martin Fowler heavily advocated the term inversion of control to describe this approach. Today IoC is more like a generic term for both DI and also IoC containers where DI is more used for describing the injection of resources either via fields or methods.

Most of the time people use both terms to refer the exact same meaning.
 
Tarik Aazizi
Greenhorn
Posts: 22
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Murat for your reply
 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!