Dependency Injection

From APIDesign

Revision as of 23:50, 26 September 2010 by JaroslavTulach (Talk | contribs)
Jump to: navigation, search

A special form of component injection following the classical Hollywood principle: the framework calls, and beans just react to such calls. See wikipedia::dependency injection.

Contents

Translation Basics

During our JavaOne2010 talk about Modularity patterns we compared dependency injection and injectable singletons. As the comparison was well accepted and as I think it revealed some things that were just implicitly present in our minds, here is an explicit enumeration. Here is the beginner's guide to modularity of dependency injection (namely Spring) fans.

Imports vs. Dependencies

TBD: Dependency injection fans look into import section to find dependencies of their code.

Versioning

TBD: No versioning in DI.

Application Factory & co.

TBD: Modularity (aka OSGi or NetBeans Runtime Container) provides only global application factories.

Initialization

TBD: Inherent in modularity. Verbose in DI.

Injection

TBD: Composable (e.g. no master description) in modularity. Explicit in DI.

Personal tools
buy