开发者

What is IoC in .NET [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

What is Inversion of Control?

I am not familiar with Invers开发者_JAVA百科ion of Control (IoC). What is IoC and how can applications benefit from using IOC. How is it implemented in .NET with C#?


If you have a set of classes that depend on eachother, it's difficult to replace some class for another (better/cheaper/faster) class that does the same job. In order to make your code more flexible, you can use dependency injection.

An easy to use DI framework for C# is Ninject. They have a very understandable tutorial about this subject.

Links:

http://ninject.org/learn

http://blog.andresays.org/2010/10/dependency-injection-with-ninject-and-asp-net-mvc/

Good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜