title: spring 3 annotation dependency injection
body: <p>For a new legacy application I have to use Latest Spring framework 3.x with Hibernate 3.x.  Earlier I used Spring IoC with xml configuration. Now i would like to go for annotation based IoC.</p>
  <p>Below link from rose india shows use annotation without xml file.
  <a href="http://www.roseindia.net/spring/spring3/configuration-spring.shtml" rel="nofollow noreferrer">rose india</a></p>
  <p>but i have found some other way of implementing in another site:
  <a href="http://weblogs.java.net/blog/seemarich/archive/2007/11/annotation_base.html" rel="nofollow noreferrer">blog</a></p>
  <p>I am confused here which way to implement IoC with latest technology.
  Please refer some good site for sample. Also please share some sample code for IoC with annotation.</p>
  <blockquote>
  <p>EDIT:</p>
  <p>Spring reference document 3.x says use <strong>@Configuration</strong> or xml configuration i.e. with annotation <strong>&lt;context:annotation-config/&gt;</strong>. Which one is better to use? Why?</p>
  </blockquote>