Sunday, June 1, 2008

Intro to Dependency Injection and Inversion of Control

From: Desert Code Camp 2008
Speaker: Donn Felker (from Statera)


90% of injection is done in the constructor of the class by passing in instances as interfaces. The other 10% is done primarily through a setter property and in rare cases as a param to a method.

IoC = Dependency Inversion Principal. A service locater returns the concrete instances of classes requested. The service locater is a container.

Microsoft.Practices.Unity is a popular Microsoft container and Windsor Castle is the most popular open source container.

Links to containers:

Windsor Castle
Microsoft Unity
Structure Map

No comments:

Post a Comment