title: Customise the creation of a gin managed object or creating two different instances of the same class
body: <p>I want to be able to create two instances of the same class and have them be injected with different properties and then have those two objects injected into two specific locations in my application.</p>
  
  <p>Currently I have a method in my ClientModule...</p>
  
  <pre><code>    @Provides
      @Named("bean1")
      public MainBean getMainBean() {
          MainBean mainBean = new MainBean(new SecondaryBean());
          return mainBean;
      }
  </code></pre>
  
  <p>And then in my presenters etc I do the following:</p>
  
  <pre><code>    public MyPresenter(final EventBus eventBus, final MyView view, 
                       @Named("bean1") MainBean bean, TitleSetupData data) {
          super(eventBus, view);
          this.bean1 = bean1;
      }
  </code></pre>
  
  <p>And it works great. Based on the @Named annotation corresponding I get the correct bean.</p>
  
  <p>However, this approach has a weakness in that I need to create and inject all the dependencies of MainBean in the @Provides method.</p>
  
  <p>So any @Inject annotations of SecondaryBean are not honoured for example.</p>
  
  <p>One thing I could do is pass into the getMainBean method any relevant dependencies but I'm wondering if there might be another more elegant or better solution.</p>
  
  <p>Anyone got any ideas?</p>