views:

249

answers:

1

I'd like to create a framework that uses IoC without needing any configuration:

So instead of (adjusted from http://www.castleproject.org/container/gettingstarted/part1/code.html):

IWindsorContainer container = new WindsorContainer();
container.AddComponent("someinterface", typeof(ISomeInterface));
ISomeInterface component = (ISomeInterface) container[typeof(ISomeInterface)];
component.DoIt();
container.Release(component);

The container.AddComponent method would not need to be called, as there would have been some initial step that did some 'auto wiring' by looking in a known directory for any dlls containing classes that implemented ISomeComponent and registered them with the WindsorContainer.

I can see that this would be possible to do from scratch, but ideally I'd like not to rewrite this code if there is an open source project out there that has already done it!

+2  A: 

It can be done in a few lines of code... these forum topics should get you started:

Mauricio Scheffer
You're fast. Leave some of these questions for me, will you? ;)
Krzysztof Koźmic
Well, you can always add another answer with more information... I'm usually lazy and answer with a link to someone who knows better than me ;-)
Mauricio Scheffer