title: Does the prototype pattern comply with dependency injection?
body: <p>During my learning about dependency injection (and acquiring first practical experience) I was wondering about one problem that occurred to me thinking about one concrete project that I'd like to tackle with DI in the near future. </p>
  
  <p>For different analyses I'd like to create objects of an injected dependency dynamically, for I'd need an arbitrary number of them, which may vary due to users interactions with my program. I thought about implementing this requirement as an abstract prototype pattern</p>
  
  <pre><code>public interface IAnalysis
  {
      SomeDataType DoSomething();
      IAnalysis CreateObject();
  }
  </code></pre>
  
  <p>Classes derived from IAnalysis will be responsible for returning a new object of that class from <code>CreateObject()</code>. Dependent classes can create new objects without knowing the concrete type, but only rely on the interface, hence a major concept of DI is complied to. Anyway, classes derived from IAnalysis will have to create new objects with the <code>new</code> keyword. I read that creating objects with <code>new</code> should be avoided outside the injector when using DI, thus I am not quite sure if this is "allowed" in DI. On the other hand this seems like a quite sensible solution to me, for the classes only create new objects of themselves, which actually should not hurt the DI principle.</p>
  
  <p>Is the concept I thought of sensible? Are there any other solutions I can use to achieve this? I actually thought about abstract factories, but this would hurt the DI principle to my understanding. </p>