Add convention over configuration features to IoC containers
NInject and StructureMap both have contextual dependency injection, and Hiro is going to be mostly conventions based.
It'd be nice if MicroKernel and Windsor supported more conventions-based approach, possibly something similar to what I outlined here: http://kozmic.pl/archive/2009/04/09/convention-based-dependency-injection-with-castle-microkernelwindsor.aspx
What exactly would you like to see: what features, what syntax, what conventions…
I have a registry base that I use that I have added conventions to for finding services like Service : IService and also registering all first interfaces of a concrete type. It would also be nice to add maybe a convention so that AbcService: IService gets registered but Abc : IService wouldnt. Another convention, maybe last to run, is to register all a type for all interfaces it implements.
My samples are here: http://geekswithblogs.net/wesm/archive/2010/02/25/sexy-windsor-registrations.aspx and the code is here http://github.com/g0t4/GotFour.Windsor
Cesar Sanz commented
+1 I support every convention over configuration stuff...
Julian, to some extent i want to make conventions configurable, but I'd also like to provide a good set of these out of the box. If you want an analogy take a look at FubuMVC request handling pipeline.
And I want to stay away from attributes as far as possible. I guess Ayende, or any other Windsor contributor will agree
Julian Birch commented
I think this could be achived by enlarging the registration API. I've written up a basic example here (with noddy implementation):
Ideally, it should be possible to implement something like the google annotations (attributes): http://google-code-updates.blogspot.com/2009/05/javaxinjectinject.html
on top of this, but tbh I dislike attribute-based configuration and would rather we started with a programmatic API and implemented attribute-based stuff on top of it.
Cnu, Ninject does not have an CoC implementation per se. It has a simple rule engine in registration API that allows you achieve that, and attributes. But it might be a good idea to consult with Nate and Jeremy and collectively come up with something.
Krzysztof, did you have a chance to take a look at the implementation of convention over configuration by NInject and StructureMap? I wonder whether they have implemented some common conventions that most developers need. If they have, that would be a good starting point.
Thanks for your active participation in the Castle project. Your Dynamic Proxy documentation is great.