DI/IoC in Java for a .NET'er used to Castle.Windsor
- by Ciddan
Is there a Java DI container that works in a similar way to the most excellent Castle.Windsor container on the .NET side?
The Java containers I've had a look at all seem to rely on annotations (Guice) within my services, which I don't dig all that much - I'd like to go POJO all the way if possible. Spring on the other hand can do without the annotations, but it requires a lot of XML. XML configuration != maintainability.
One of the really nice things about Castle.Windsor is the wiring you're able to set up in code with Installers, auto wiring based on naming conventions and whatnot.
Ideally the container should also support lifecycle management and configuration; i.e. registering components as transient, singleton, pooled etc.
Another bonus would be support for interceptors.
Any tips would be greatly appreciated.