title: Dagger2 Subcomponent module override
body: <p><code>ApplicationComponent.java</code></p>
  
  <pre><code>@Component(modules = SomeModule.class)
  @ApplicationScope
  public interface ApplicationComponent {
      // stuff
      ActivityComponent activityComponent();
  }
  </code></pre>
  
  <p><code>ActivityComponent.java</code></p>
  
  <pre><code>@Subcomponent(modules = AnotherModule.class)
  @ActivityScope
  public interface ActivityComponent {
      // stuff
      void inject(MainActivity mainActivity);
  }
  </code></pre>
  
  <p><code>SomeModule</code> can be overriden using something like <a href="http://artemzin.com/blog/jfyi-overriding-module-classes-with-dagger2/" rel="nofollow">this</a>. But how about <code>AnotherModule</code>?</p>
  
  <p>One solution would be to separate the 2 components, but what if I want to reuse some bindings from the parent?</p>
  
  <p>edit:</p>
  
  <p><code>MainActivity.java</code></p>
  
  <pre><code>onCreate(Bundle bundle) {
      getApplicationComponent().getActivityComponent().inject(this);
  }
  </code></pre>
  
  <p>edit2:</p>
  
  <p><code>ActivityRyle.java</code></p>
  
  <pre><code>init() {
      application.setComponent(DaggerApplicationComponent.builder()
                      .someModule(new TestSomeModule(application))
                      .build();
  }
  </code></pre>
  
  <p>edit3: I'm trying to avoid wiring too much stuff in <code>Application</code> (where the main component is created).</p>