Hello,
Guice allows you to do this with
Java in a type-safe manner. You may use annotations or skip them altogether. I prefer this approach because I signed up to write in Java not XML =)
Having said that however, there are some use cases where external configuration is more flexible and XML is appropriate for these use cases. I would not frame it as annotations vs. XML so much as Java vs. non-Java.
Dhanji.