Ian's Software for Mere Mortals

Youngjune or Ian's blog about Connectivity

C# sample code for interface injection

C# sample code for interface injection

  • Comments 3

I read a great article titled "Inversion of Control Containers and the Dependency Injection pattern" written by Martin Fowler. But, as for me the interface injection pattern was a little confusing. I wrote a sample code in C# based on his article, but the sample doesn’t implement a container. I think it will make it easier to understand the pattern itself.

  • Hi Young, this technique is one of the foundations of an AOP framework called Spring. Initiated on the Java/J2EE platform, it also exists on .Net : http://www.springframework.net/index.html
  • If you want to see another example of the IoC/DI pattern in .NET, check out ObjectBuilder from Microsoft Patterns & Practices - it's part of the Composite UI Application Block, and part of Enterprise Library 2.0.  They're also using it in the Smart Client Software Factory, and the Mobile Client Software Factory.

    It's a stunning piece of work, and really brings IoC/DI to a level where anyone can use it.  Well worth the time to check out.
  • Thanks for the sample
Page 1 of 1 (3 items)