title: Injecting EJB into servlet via remote interface
body: <p>I am reviewing some Jave EE 6 code and having doubts about its correctness:</p>
  
  <pre><code>@WebServlet
  public class FooServlet {
    @EJB
    private transient BarRemoteInterface bar;
  }
  
  @Remote
  public interface BarRemoteInterface {
  }
  
  @Stateless
  public class BarBean implements BarRemoteInterface {
  }
  </code></pre>
  
  <ul>
  <li><p>I am wondering if that is true that the <code>transient</code> keyword does not make any sense as the injected proxy will not be serialized. (Or will be, but without effect?)</p></li>
  <li><p>I think that it would be more effective if we didn't inject the remote interface as that uses pass-by-copy parameter passing. Instead we'd rather inject the EJB with <code>@EJB BarBean</code> so that it's automagically generated (?) local interface will be used. Am I right?</p></li>
  <li><p>In this case even the <code>@EJB</code> could be replaced with <code>@Inject</code> as that is more general</p></li>
  </ul>
  
  <p>Can you comment on my thougths if they are correct?</p>