Answers

Your answer has been posted.

 

Rick H

CEO/Founder at Mammatus Inc.

see all my questions

When should you use Spring Annotations for DI and when should you use Spring XML for DI?

I wrote this article:
http://java.dzone.com/articles/dependency-injection-an-introd
The article covers Spring DI and Spring 2.5 DI features including Spring Annotations for Dependency Injection.

I would like to get your ideas on this concept.

When should you use Spring Annotations for DI and when should you use Spring XML for DI?

You can reply here at linkedin and/or here: http://java.dzone.com/articles/dependency-injection-an-introd

posted November 11, 2008 in Software Development | Closed

Share This Question

Share This

Answers (3)

 

Nick L

Software Engineer, Google

see all my answers

I'm working on an article that'll tackle the same question for Guice. I'm surprised that the notion of annotations is so controversial. But hey, to each his own. I like that Spring offers you the option of both, or as much of either as you like. I guess it all depends on how heavily you want your source code tied to a particular framework. In practice though, once you use a framework, you're going to be hard pressed to switch it to another without *some* effort. So I think the notion of annotations inhibiting a move is a red herring. Good article btw...