title: EJB 3.1. Is @Local annotation needed?
body: <p>So far, I almost always worked with no-interface EJBs and have a slight understanding about the need of @Local annotation. Consider this example:  </p>
  
  <pre><code>public interface MyBeanIntf { void doStuff(); }
  
  @Stateless
  public class MyBean implements MyBeanIntf { public void doStuff(){ } }
  </code></pre>
  
  <p>Should the <code>MyBeanIntf</code> be marked as <code>@Local</code>? I don't see any benefit from that, because even when I don't annotate it as <code>@Local</code>, I still can use <strong>DI</strong> to properly inject it into UI Controller:</p>
  
  <pre><code>@Named
  @SessionScoped
  public class TestController implements Serializable {
  
    // injection works perfectly, even when MyBeanIntf is not marked as @Local
    @Inject
    private MyBeanIntf myBean;
  
    // or even like this:
    // @EJB
    // private MyBeanIntf myBean;
  
  }
  </code></pre>
  
  <p>Let's make it more complex:</p>
  
  <pre><code>public interface MyBeanIntf { void doStuff(); }
  public class MySuperBean implements MyBeanIntf { public void doStuff() { } }
  
  @Stateless
  public class MyBean extends MySuperBean { }
  </code></pre>
  
  <p>Is <code>MyBean</code> now considered a valid <code>Local EJB</code> bean? I have some doubts because it implements the interface indirectly.</p>