Looking for some sort of pattern
<p>I have a library project which contains an abstract class, let's say <code>ClassA</code>. In the project that uses that library project, I have <code>ClassB</code> that extends <code>ClassA</code>.</p>

<p>Now here's my problem. In the library project I want to use an instance of the implemented <code>ClassB</code>, but I have no idea how to retrieve that instance. Is there any pattern or other ideas for this?</p>

<p><a href="http://s3.amazonaws.com/twitpic/photos/full/326584019.png?AWSAccessKeyId=AKIAJF3XCCKACR3QDMOA&amp;Expires=1308603198&amp;Signature=N4yDX66sr7fDCGDaHXmY/MXBcmY=" rel="nofollow">Here's</a> a simple diagram of the situation.</p>

<p><strong>Edit</strong></p>

<p>The reason I'm asking is that I'm creating multiple applications, which only have different methods in <code>ClassB</code>. Therefore I'm creating a library that all of these applications can use, only having to extend <code>ClassA</code>. These applications are separate projects, using the library.</p>
