Going down the IoC rabbit hole

I’ve started a new position and one of the first projects I’m going to be working on relies on Windsor to do it’s dependency management. Having only had a small amount of exposure before, I’m looking forward to the opportunity to learn more about the technology and the principles behind it in a practical application. For anyone with experience out there, what are the benefits and the pitfalls associated with using this?

I have a list of concerns of my own but I’m trying to keep an open mind because of my limited exposure. I’d certainly love to hear what other people think about using it and what their experiences have been like. I’ll follow up with my own experiences after a few weeks.

Related Articles:

Post Footer automatically generated by Add Post Footer Plugin for wordpress.

This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://blog.latrompa.com Hernan Garcia

    i think it’s great. It took my team (and me) a day or two to get used to it. One of the things we found very important is make sure you properly define the lifestyle of your objects, singleton, transient, etc. Or you may see some strange behaviours in your app, that can be very difficult to find. I also found very interesting the presentation done by Mario Cardinal on Agile 2008 about where to use Ioc. He has a chat in arcast.tv about the same issue: http://www.mariocardinal.com/Posts/20080909.html.

  • http://ruprict.wordpress.com Ruprict

    DI/IoC helped all aspects of my design and coding. It helped me bake in testability and stick to the Single Responsibility Principle. I am a Windsorist from way back, so my objectivity on IoC containers and, even, Windsor, is probably gone by now. There are a TON of resources about Windsor (and IoC) out there, so you may want to see how people are implementing. For example, there are at least 3 ways to configure the container in Windsor (XML, Binsor (boo), and fluent interface) My guess is you’re about to find out how great this concept and framework really are.

  • Jason

    I’ve been using Windsor for almost a year. I first discovered in the Rhino.Tools stack. Even after a year I only know/use/understand 20% of of the Framework.

    There seem to be limitless ways to configure Windsor. The fluent interfaces are great, there are numerous hooks to modify the basic configuration, and there are even attributes which make configuration a breeze. The trade of is infrastructure in the domain.

    Take advantage of Facilities, they allow you to encapsulate common functionality. For example You could have a facility to configure your Repositories, and another to configure MVP/C, and another to… etc.

    The castle forum on google is a great resource for questions.

    Not only can Windsor manage your dependencies (both required, ctor, and optional properties), you can supply smarts to determine how/when/what is injected.

  • peter

    a guy I work with insists that ioc is evil and breaks information hiding in basic OO. we’re having long debates on this. I on the other hand see a benefit to it, and its saved me in many occassions. The only down side for me is the complexity that goes with it. Its NOT complex as your building your app, but a few months later when the new guy has to maintain the code .. that when it gets interesting :-)

  • http://www.lostechies.com/members/jcteague/default.aspx jcteague

    We had some interesting discussions at KaizenConf about Advanced IOC usage and one thing that Ayende talked about is using Conventions to wire up your dependencies automatically and only using configuration when when breaking from the configuration.

    For instance, all controllers are connected using Transient lifetime while repositories are singleton lifetime. It sounds like a great way to reduce configuration pain. I’m hoping to do some spikes this week and get a blog post out soon. We’ll see if I deliver :)