title: Guice Injection with Inheritance
body: <p>First, I'm sorry I could not get more specific wording for my title. Here is my code snippet:</p>
  
  <pre><code>public abstract class A {
   // dependencies
   private Client client;
  
   @Inject 
   public A(Client client) {
      this.client = client;
   }
  
   public abstract foo();
  
   protected void bar() {
    client.bar();  
   }
  }
  
  public class B extends A {
   ...
  }
  
  public class C extends A {
   ...
  }
  </code></pre>
  
  <p>My problem is this: Neither <code>B</code> nor <code>C</code> actually care how <code>boo</code> method is implemented in <code>A</code>. <code>A</code> uses <code>client</code> only for <code>boo</code> implementation. I do NOT want to keep injecting <code>client</code> via constructors of <code>B</code> and <code>C</code>. What are my options? I think I can use <code>@Inject</code> annotation directly on the <code>client</code> field declaration instead of constructor. Is this a good approach? Are there any other recommended ways? Or Am I misunderstanding something about DI here?</p>
  
  <p>Thanks in advance,
  Bhargava</p>