title: Can I pass other components into Castle Windsor config?
body: <p>Lets say I have a main component that I want to initialize in a specific way and I have it's constructor take an Interface for this purpose. Is there a way to define the implementation I want for this interface in my xml and in turn inject that into the main component as a parameter? Like this:</p>
  
  <pre><code>public interface IComponent2 {
      void DoStuff();
  }
  
  public class ConcreteCompImpl2 : IComponent2 {
  
      IComponent1 _comp;
      public ConcreteCompImpl2(IComponent1 comp) {
          _comp = comp;
      }
  
      public void DoStuff(){
          //do stuff
      }
  }
  
  
  
  &lt;component id="component1" service="ABC.IComponent1, ABC" type="ABC.ConcreteCompImpl1, ABC" /&gt;
  &lt;component id="component2" service="ABC.IComponent2, ABC" type="ABC.ConcreteCompImpl2, ABC" &gt;         
      &lt;parameters&gt;
         &lt;component1&gt;???&lt;/component1&gt;
      &lt;/parameters&gt;
  &lt;/component&gt;
  </code></pre>
  
  <p>Or am I thinking about this all wrong and there is a much simpler way to accomplish this? The main thing I want to be able to do is configure what 'kind' of IComponent1 will get injected whenever an IComponent2 is created. Thanks</p>