title: Spring - Autowiring vs manual method call
body: <p>I saw a lot of examples of this (option 1):</p>
  
  <pre><code>@Bean A a(){
    return new A();
  }
  
  @Bean B b(){
    return a().makeB();
  }
  </code></pre>
  
  <p>What are advantages of this comparing to (option 2):</p>
  
  <pre><code>@Bean A a(){
    return new A();
  }
  
  @Bean B b(A a){
    return a.makeB();
  }
  </code></pre>
  
  <p>From what I can tell, using option 1 it is easier to navigate between beans (but with support from IDE, it is as easy to do so in option 2 also). Downside is I guess coupling, so in tests it is harder to overwrite bean A in bean B, since it is directly referenced (in option 1).</p>
  
  <p>Is there any other particular reason to use option 1 (eg. speed, or smthn.)?</p>