title: Castle Windsor Component dependencies and lifestyles
body: <p>I'm wondering what the best practice is for Castle Windsor component dependency lifestyles.  For example if I have a Repository class that is dependent on an ISession.  If the Repository is set as PerWebRequest, but the ISession is set as transient, will this pose any problems for the windsor releasing the components so the GC can correctly clean up?  </p>
  
  <p>Logically this seems like it will work, because every request for a Repository during the webrequest will get a reference to the same instance.  That instance will hold a reference to the single ISession that was instantiated to satisfy the Repo dependency when it was first requested.  Windsor will know when the Repo is out of scope due to the PerWebRequest tracking, and thus should know when to clean up the ISession.</p>
  
  <p>However, <a href="https://stackoverflow.com/questions/3776975/appropriate-lifecycle-for-repository-classes-using-castle-windsor/3778262#3778262">this post</a> by Krzysztof Koźmic implies that you shouldn't have a component dependent on something with a shorter lifestyle than itself.</p>
  
  <p>[edit]</p>
  
  <p>My question is, is it acceptable to have a Windsor Component depend on something with a shorter lifestyle than itself (i.e. PerWebRequest component -> Transient component)?</p>