O'Reilly logo

Dependency Injection: Design patterns using Spring and Guice by Dhanji R. Prasanna

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Best practices in code design

"The effort to understand the universe is one of the very few things that lifts human life a little above the level of farce and gives it some of the grace of tragedy."

—Steven Weinberg

It's often a puzzle to programmers who are new to dependency injection about when to apply it. When it wasn't widely understood, even experienced practitioners applied it too much or too sparingly. The immature state of libraries contributed to this fuzzy application too, giving one the tools but not the discretion of its applicability.

A more fundamental set of confusion arises from the best practices of the language itself. Are these distinct from the patterns relevant to DI? Are they superseded? Or can they coexist (figure ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required