Skip to Main Content
The Well-Grounded Java Developer
book

The Well-Grounded Java Developer

by Benjamin Evans, Martijn Verburg
July 2012
Intermediate to advanced content levelIntermediate to advanced
496 pages
16h 42m
English
Manning Publications
Content preview from The Well-Grounded Java Developer

Chapter 3. Dependency Injection

This chapter covers

  • Inversion of Control (IoC) and Dependency Injection (DI)
  • Why DI is an important technique to master
  • How JSR-330 united DI for Java
  • Common JSR-330 annotations such as @Inject
  • Guice 3, the reference implementation (RI) for JSR-330

Dependency Injection (a form of Inversion of Control) is an important programming paradigm that has become part of mainstream Java development since about 2004. In short, DI is a technique in which your object gets its dependencies given to it, as opposed to having to construct them itself. There are many benefits to using DI—it makes your codebase loosely coupled, easier to test, and easier to read.

This chapter begins by cementing your knowledge of DI theory ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Performance and Instrumentation for the Well-Grounded Java Developer

Java Performance and Instrumentation for the Well-Grounded Java Developer

Benjamin J. Evans
Java By Comparison

Java By Comparison

Simon Harrer, Linus Dietz, Jörg Lenhard
DevOps Tools for Java Developers

DevOps Tools for Java Developers

Stephen Chin, Melissa McKay, Ixchel Ruiz, Baruch Sadogursky
Optimizing Java

Optimizing Java

Benjamin J. Evans, James Gough, Chris Newland

Publisher Resources

ISBN: 9781617290060Publisher SupportOtherPublisher WebsiteErrata PageSupplemental ContentPurchase Link