title: How does autowiring work in Spring?
body: <p>I'm a little confused as to how the <a href="http://en.wikipedia.org/wiki/Inversion_of_control" rel="noreferrer">inversion of control</a> (<code>IoC</code>) works in <code>Spring</code>.</p>
  
  <p><strong>Say I have a service class called <code>UserServiceImpl</code> that implements <code>UserService</code> interface.</strong></p>
  
  <p>How would this be <code>@Autowired</code>?</p>
  
  <p>And in my <code>Controllers</code>, how would I <code>instantiate</code> an <code>instance</code> of this service?</p>
  
  <p>Would I just do the following?</p>
  
  <pre><code>UserService userService = new UserServiceImpl();
  </code></pre>