title: CDI injection of bean from parent module to child module
body: <p>Question only about CDI beans, not EJB.</p>
  
  <p>Is it good practice to develop architecture where you need to inject bean from parent module to child module?</p>
  
  <p>For example I have three modules:</p>
  
  <ol>
  <li><strong>common</strong> - here i need to use some environment setting, but <strong>common</strong> doesn't know in which environment it will be executed, client or server (in my case it is packaged as a lib in a ear/lib directory and separately it is tested by java se client);</li>
  <li><strong>client</strong> - here I can provide settings from properties file for example (for testing purpose, it is not packaged in ear)</li>
  <li><strong>server</strong> - here I can provide settings from ejb configuration file (it is a ejb module in same ear as common).</li>
  </ol>
  
  <p>So <strong>client</strong> depends on <strong>common</strong> and <strong>server</strong> depends on <strong>common</strong> (they extend and use classes from common) but injection goes in reverse direction. So @Inject injection point exists in <strong>common</strong> module, but producer methods in <strong>client</strong> and <strong>server</strong>.</p>
  
  <p>Additionally to philosophical aspect I have a real question. Can I further inject bean from ejb.jar to ear/lib/*.jar or it will be impossible due classpath issues?</p>
  
  <p>Regards</p>