DI: Annotation or XML Configuration
Recently I have been looking at couple of DI containers in Java. These are: Google Guice and Spring Framework. I did not like Guice in the first look itself. It involved annotating my beans with Guice specific annotations. I felt this was defeating the purpose of POJO. XML configuration using Spring was more natural for me.
Spring does have DI Annotations. @Component/@Autowired and others were added in Spring 2.5. Spring 3.0 has even more annotations. Spring does use it’s own annotations by default; however, it does allow you to use your own annotations instead, if you wanted to.
Solomon
16 Dec 08 at 6:07 pm