• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Tarik Aazizi
Greenhorn
Posts: 19
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.
 
Murat Yener
Author
Greenhorn
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: 19
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Murat for your reply
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!