IoC (Inversion of Control) tutorial

Topics: Code
Coordinator
Feb 20, 2008 at 5:47 PM
I found this excellent IoC tutorial in a blog post I found in one of those aggregated .NET rss feeds. This is a very simplified example, but it sure helped me understand this concept. It took me 3 times reading it, before I got my "Aha!" moment. Here's the link:

http://weblogs.asp.net/sfeldman/archive/2008/02/14/understanding-ioc-container.aspx
Feb 20, 2008 at 8:43 PM
Edited Feb 20, 2008 at 8:44 PM
Good timing as ms released a ctp of their new IoC framework a few days ago...

http://www.codeplex.com/unity
Coordinator
Feb 20, 2008 at 10:00 PM
Yeah, I saw that on http://www.dotnetkicks.com yesterday. Larkware News used to give daily .NET news. Unfortunately it closed at the beginning of this year, so now I get my news from DotNetKicks. Lots of interesting links that's for sure.

I read about Unity, but I wasn't able to understand what they were doing, since I didn't understand the concept behind IoC. Now that I do, I'm going to check out the most common containers out there. :)
Feb 21, 2008 at 8:42 AM
I do actually have a subset of the WM framework implemented using IoC principles and Spring.net as a container if you are interested in it. Its very rough around the edges as it was my "learning tool" for spring.net but you are welcome to the code.
Coordinator
Feb 21, 2008 at 6:33 PM

foxedup wrote:
I do actually have a subset of the WM framework implemented using IoC principles and Spring.net as a container if you are interested in it. Its very rough around the edges as it was my "learning tool" for spring.net but you are welcome to the code.

I was thinking that IoC would help us immensely. That would sure help cut down on the tight coupling that we have right now between the major systems.

So, why did you choose Spring.NET? And, yes, I would love to see your test code.

From my point of view, let's use the framework that has the least dependencies and is also simple (relatively speaking) to setup and use. I'm aware of the major ones:

  • Unity
  • Windsor
  • Spring.NET
  • StructureMap
  • ObjectBuilder
  • Autofac
Feb 21, 2008 at 8:38 PM
The reason I chose spring was because my place of work at the time had a java team that used spring (one of them was a contributor), so i had access to technical support :)

I havent used any of the other frameworks out there so cant really comment on them
Coordinator
Feb 22, 2008 at 3:04 AM
Edited Feb 22, 2008 at 3:08 AM
Well, now I can see why Spring.NET is so popular. It really has the best documentation of all the frameworks that I have tried. I haven't looked at Unity that close yet, but I'm already quite convinced that Spring is it. I never really like Enterprise Library (EntLib) that much. I worked with it when I was working at Avanade. They added a boatload of stuff to EntLib. Bloatware!

It just occurred to me, that the new CoreManager is acting as a partial IoC/DI container. I didn't realize that our main systems were actually quite decoupled already. That's good news! :)

We should convert to Spring.NET after we do our first source release.