views:

368

answers:

6

I am currently trying to get my head round DI and IoC.
Blogs and article are all well and good but I'd like to see some real working source code however I am currently stuck with web forms at work for the time being and most open source projects that I know of that are implementing these kind of development practices seem to be based on ASP.NET MVC i.e. nerd dinner.
Can anyone point me in the direction of an open source web form based project that uses DI/IoC?

A: 

What about Spring.NET? I've used it successfully on ASP.NET (non-MVC) projects, it works very well. While I can't point you at a specific project which uses it, it is pretty well documented and has many samples.

Vinay Sajip
+1  A: 

Take a look at n2 cms it's an open source CMS

Mike
Cheers Mike, looks promising.
Andy Rose
i've used it for several commercial projects and it works very good
Mike
A: 

The MSDN page for Unity contains a tiny web project. It might not be as big a project as you're looking for, but it's really clear and should help with understanding.

Andrew Barrett
A: 

Take a look at Sharp Architecture. It has a sample project (Northwind) withe DI http://code.google.com/p/sharp-architecture/

he asked for a webforms project
Mauricio Scheffer
A: 

Take a look at the Web Client Software Factory

CitizenBane
A: 

I strongly recommend ninject and the guide that comes with it.

There are a few reasons why I make the recommendation. First, because it is how I learned about using actual IoC containers. Second, because the guide is very strait forward with examples using poor man's DI, to using ninject, to some of the really cool things you can do with ninject. Lastly, ninject is one of the easier to work with OSS IoC containers and it doesn't need xml configuration.

That said. Once you get confortable with ninject, make sure you check out Structure Map and castle windsor

Also get familiar with the singleton pattern, because it adds a lot of value to what you will need to do with inversion of control and without it, a lot of the IoC features may not seem valuable.

Once you have a feel for what an IoC container can be useful for, you will know where you can use one in your ASP.NET applications. As for specific examples, why not create one after you learn?

Ty