views:

29

answers:

1

The app I inherited uses the fluent interface for configuring our Windsor container, and it's this big glob o' configuration that's pretty disgusting.

In the past I created an extension method container.AddModule and then created modules that were passed in the container and registered services a la StructureMap for the different "modules" of my system that need configuration.

container.AddModule(new FooModule());
...
public class FooModule : IWindsorModule
{
  public Register(IWindsorContainer container)
  {
    container.Register(/*Windsor's Ridiculous Fluent Syntax*/);
  }
}

Is that what facilities are in Windsor? Are the analogous to StructureMap modules or are they extension points for adding super-magic to Windsor?

What is the best-practice for making your container config more modular and less insane?

+1  A: 

Check out IWindsorInstaller:

Also if you're coming from StructureMap this article might be useful.

There's a thin line with Facilities but in general, facilities are intended to be used for more complex stuff that requires custom configuration / several internal components, etc.

Mauricio Scheffer
How could I have not seen this before? Perfect!
James Thigpen