ASP.NET - what is Dependency Injection and Inversion of Control in ASP.NET?

Asked By Tridip Bhattacharjee on 03-Feb-10 01:54 AM
what IOC and why it is require and how it help us. if possible then please discuss the idea in detail.
Thanks in advance
Sakshi a replied to Tridip Bhattacharjee on 03-Feb-10 01:59 AM

see these links , they have good explanation with code from authorised people,

http://www.mikesdotnetting.com/Article/117/Dependency-Injection-and-Inversion-of-Control-with-ASP.NET-MVC

http://aspnetresources.com/articles/real_world_ioc_and_di_with_webforms.aspx

http://dotnetshoutout.com/Dependency-Injection-and-Inversion-of-Control-with-ASPMET-MVC


DL M replied to Tridip Bhattacharjee on 03-Feb-10 02:46 AM
what IOC and why it is requir?

http://www.iridescence.no/post/Inversion-of-Control-ASPNET-MVC-and-Unit-Testing.aspx

http://www.javabeat.net/qna/22-what-is-inversion-of-controlioc-or-dependen/

http://weblogs.asp.net/shijuvarghese/archive/2009/03/12/applying-dependency-injection-in-asp-net-mvc-nerddinner-com-application.aspx
Huggy Bear replied to Tridip Bhattacharjee on 03-Feb-10 03:14 AM
Inversion of Control (IoC) means that objects do not create other objects on which they rely to do their work. Instead, they get the objects that they need from an outside source (for example, an xml configuration file).

Dependency Injection (DI) means that this is done without the object intervention, usually by a framework component that passes constructor parameters and set properties.

Check http://www.martinfowler.com/articles/injection.html for more information.