This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Dependency Injection Usage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Dependency Injection Usage" Watch "Dependency Injection Usage" New topic
Author

Dependency Injection Usage

Vinod Kumar Kashyap
Greenhorn

Joined: Sep 19, 2006
Posts: 11

Hi,

I want to know that dependency Injection is only associated with Spring only.
Or it can be used in other frameworks also like Struts.

It can also be used alone?

Thanks,
Vinod
Dhanji Prasanna
author
Ranch Hand

Joined: Aug 30, 2009
Posts: 38
No it is incorrect to say it is associated with Spring only. In fact at Google we mainly use Guice and use it in various applications ranging from the web to other backend services.

You can use either Spring or Guice with or without Struts2, Stripes, Wicket or most web frameworks. Struts2 and Wicket have pretty good support for integrating Spring or Guice.

Some web libraries, like Tapestry, provide their own DI systems.

Dhanji.


Software Engineer at Google

http://twitter.com/dhanji
Vinod Kumar Kashyap
Greenhorn

Joined: Sep 19, 2006
Posts: 11

Hi,

Thanks for the reply.

I am confused for sometime about the DI and not able to gather information i.e. what is to be studied and why do study it.
Does it plays a enormous role in the programming? I am Java developer and love to gain info on new technologies.
Does DI is a new concept and can it help me to solve my problems?.
Will it help to increase my performance in the field of Java?
Does it helps me to be more productive?

Thanks,
Vinod
Dhanji Prasanna
author
Ranch Hand

Joined: Aug 30, 2009
Posts: 38
Yes to everything =)

I'd encourage you to download this green paper my book (free pdf download at http://manning.com/free/green_prasanna.html ) and to watch this introductory talk: http://www.youtube.com/watch?v=hBVJbzAagfs

They go into a lot more detail and will answer your questions with concrete examples.
Thanks,

Dhanji.
Vinod Kumar Kashyap
Greenhorn

Joined: Sep 19, 2006
Posts: 11

Thanks Dhanji,

I will read the green paper and then ask you a question if any.


Thanks,
Vinod
 
GeeCON Prague 2014
 
subject: Dependency Injection Usage