Welcome to MSDN Blogs Sign in | Join | Help

C# sample code for interface injection

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.

Published Wednesday, May 24, 2006 5:28 PM by yjhong
Filed under:

Comments

# re: C# sample code for interface injection

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
Wednesday, May 24, 2006 7:33 AM by Pierre

# re: C# sample code for interface injection

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.
Wednesday, May 24, 2006 11:34 AM by drborts

# re: C# sample code for interface injection

Thanks for the sample
Sunday, June 11, 2006 11:23 PM by Steve
New Comments to this post are disabled
 
Page view tracker