Dependency Injection

Published on Monday, November 18, 2013

DI: Dependency Injection. 

What is Dependency Injection ?

Wiki: Dependency injection is a software design pattern that allows the removal of hard-coded dependencies and makes it possible to change them, whether at run-time or compile-time

IoC: Inversion of Control principle

Wiki: In software engineering, inversion of control (IoC) is a programming technique, expressed here in terms of object-oriented programming, in which object coupling is bound at run time by an assembler object and is typically not known at compile time using static analysis.

With Inversion of Control (Ioc), consumer objects do not create the other objects on which they rely. Those objects come from an external source. (from ASP.NET)

1: DI vs IoC;

2: ASP.NET MVC 3 Independency Injection

3: About DI