text: Q:
  
  Should I call ioc.release() on object created by abstract factory?
  
  I have a simple diagram editor, and after reading books on IoC and DI, I decided to try to decouple my code with help that they provides. It looks like when user add diagram item to diagram, item is created by abstract factory and added to internal diagrams list of items. But what to do where user whants to delete item from diargam? First i should delete item from internal list. Then i have some misunderstanding on sould i IoC.Release(Item) or not? If I do not call IoC.Release(Item) (avoiding any knowledge of IoC inside my objects), what happend with Item inside IoC. 
  PS: I am trying to use Castle Windsor
  
  A:
  
  When you create a component using an abstract facility(which I assume is implemented using the Windsor TypeFactory) you component will not be garbage collected if you don't release them. The components can be release by either of :
  
  Creating a Release method on you abstract factory. This method should take one argument (usually object) and a void return type. Calling this method will release the created component.
  Releasing the factory. This will release all components created by the factory.
  
  In generally it is a bad idea to call the container directly. Only call the container directly to: 
  
  Setup the container.
  Resolve your top level component.
  Dispose of the container (and all components inside)
  
  I hope this helps.
  Kind regards,
  Marwijn.
  
  