Injecting a factory with multiple constructor parameters
<p>Initially I needed only one queue to be created by the <code>MessageQueueFactory</code>:</p>

<pre><code>container.RegisterSingleton&lt;IMessageQueueFactory&gt;(() =&gt; {
    var uploadedWaybillsQueuePath = ConfigurationManager
        .AppSettings["msmq:UploadedDocumentsQueuePath"];
    return new MessageQueueFactory(uploadedWaybillsQueuePath);
});
</code></pre>

<p>Now that requirements have changed there's a need to support several queues. </p>

<p>The simplest thing I can do here is to add other paths (stored in <strong>app.config</strong>) to the factory's constructor and provide methods for each queue:</p>

<pre><code>container.RegisterSingleton&lt;IMessageQueueFactory&gt;(() =&gt; {
    var uploadedDocsQueuePath = ConfigurationManager
        .AppSettings["msmq:UploadedDocumentsQueuePath"];
    var requestedDocsQueuePath = ConfigurationManager
        .AppSettings["msmq:RequestedDocumentsQueuePath"];

    return new MessageQueueFactory(
        uploadedWaybillsQueuePath,
        requestedDocsQueuePath
    );
});

interface IMessageQueueFactory {
    MessageQueue CreateUploadedDocsQueue();
    MessageQueue CreateRequestedDocsQueue();
}
</code></pre>

<p>Is it a poor design? How can it be refactored?</p>