title: names and aliases using @Bean and @Component in spring
body: <p>How do we define </p>
  
  <p>a) Single names<br/> b) Multiple names(aliases)<br/></p>
  
  <p>Using @Bean and @Component annotations ? </p>
  
  <p>In XML we define like this:<br/></p>
  
  <p>For single name:</p>
  
  <pre><code>&lt;bean name="accountService" autowire="constructor" class="com.wiley.beginningspring.ch2.AccountServiceImpl" autowire-candidate="false"&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>For aliases:</p>
  
  <pre><code>&lt;bean name="accountService,a,b" autowire="constructor" class="com.wiley.beginningspring.ch2.AccountServiceImpl" autowire-candidate="false"&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>But what about @Bean and @Component( or @Service , @Repository ) ?</p>