• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 22
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Murat for your reply
 
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic