We use Windsor as our IoC container.  Currently we use xml as the method by which components are registered.  Having done both, I prefer the xml mapping to code registration because I can change something in the app on the fly if I need to. I know some of you out there will disagree with me on this but that's ok.

One of the annoyances with xml is that you have to type the namespaces and classes along with assembly names.  We've found there is friction when we refactor our classes, changing names, moving classes,  and adding namespaces in that Windsor bombs.  When using the xml for configuration you don't get compile time checking, so a successful build may not mean working code, which in my opinion is bad.

We've simply added the following test to our unit-test project.  It still doesn't fail when compiling, but fails instead when we run unit-tests, which is closer to compilation than run-time.

   1: [Test]
   2: public void Can_initiate_Windsor()
   3: {
   4:     IWindsorContainer container = new WindsorContainer("windsor.config.xml");
   5: }

That's it!  It's very straight forward because all it's trying to do is start up windsor, the same way your application would, any exception that is thrown fails the tests, which causes the build to fail.


 
Wednesday, August 27, 2008 7:12:45 PM (Central Standard Time, UTC-06:00)
Have you tried Binsor at all? I cant say I have had the time, but am very keen to bust out #Dev and give it a go.
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview