Preface

 

The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man.

George Bernard Shaw

So, novice-expert-aficionado-learner, welcome to our dependency injection theme park! We’ll begin this tour of dependency injection at the gate: by first defining the problem it solves.

The tour will then proceed down the streams of specific implementations and popular technologies, examining quick solutions in such frameworks as Guice, Spring, and PicoContainer, among others. A long break will follow for the purpose of theoretical nourishment, where we shall discuss the foundational idioms behind dependency injection, its core viral ideology, its types and practices.

Then, we’ll peruse the hall of curiosities where we consider such peculiar notions as objects with managed state, lifecycle, and modularity and examine their curious aspectual behaviors.

In turn, we’ll descend into the caverns of pitfalls, nuances, and corner cases that ought to titillate and horrify the strongest of constitutions; for when you cross these lines you can expect the demons of class loading, dynamic proxying, and unintended encapsulation to rear their ugly heads, only to be shown up by even greater challenges of concurrency.