title: Why I inject the same bean, but injected different class actually?
body: <p><strong>A.java</strong></p>
  
  <pre><code>@Controller
  @RequestMapping(value = "/a")
  public class A {
      @Resource(name = "foo")
      private Foo foo;
  }
  </code></pre>
  
  <p><strong>B.java</strong></p>
  
  <pre><code>@Controller
  @RequestMapping(value = "/b")
  public class B {
      @Resource(name = "foo")
      private Foo foo;
  }
  </code></pre>
  
  <p><strong>x-spring.xml</strong></p>
  
  <pre><code>&lt;alias name="foo1" alias="foo"/&gt;
  &lt;bean id="foo1" class="com.example.Foo1" scope="tenant"&gt;
  </code></pre>
  
  <p><strong>y-spring.xml</strong></p>
  
  <pre><code>&lt;alias name="Foo2" alias="foo"/&gt;
  &lt;bean id="foo2" class="com.example.Foo2" scope="tenant"&gt;
  </code></pre>
  
  <p>Foo1 derived from Foo2. Project using Hybris, scope is tenant(defined by Hybris).</p>
  
  <p>As above, I inject <strong>"foo"</strong> into <strong>Class A</strong> and <strong>Class B</strong>, and <strong>x-spring.xml</strong>, <strong>y-spring.xml</strong> loaded one by one. But I found the bean injected are different, it's <strong>Foo1</strong> in <strong>Class A</strong>, and it's <strong>Foo2</strong> in <strong>Class B</strong>, I wonder why they are different, and how to align them to Foo1.</p>