nDependency injection (Martin Fowler –
2004)
nBeans
define their dependencies through constructor arguments or properties
nDependencies used from within a bean aren’t asked for outwardly, but are injected into the bean by the
container, ie the container
provides the injection at runtime
n“Don’t talk
to strangers”, also known as the Hollywood principle – “don’t call me I will call you”
nDecouples
object creators and locators from application logic. Easy to
maintain and reuse
nTesting
is easier