title: Plugin pattern in C#
body: <p><strong>Problem:</strong><br>
  I am constructing a framework which accepts a file, <strong>translates</strong> it and <strong>executes</strong> it. The framework should be able to handle any type of file, to this end i have provided a method of uploading a DLL containing classes and methods for <strong>translating</strong> and <strong>executing</strong> a file. What i am looking for, is the <strong>best way to define the plugin interface</strong></p>
  
  <p><strong>Solution A:</strong><br>
  Define a set of interfaces which are publicly available. Plugins should implement these interfaces.</p>
  
  <p><strong>Solution B:</strong><br>
  Define some abstract classes which are publicly available. Plugins should inherrit and override the abstract methods on these classes.</p>
  
  <p><strong>Solution C:</strong>  <a href="https://stackoverflow.com/users/261869/rcravens">rcravens</a><br>
  Pass interfaces around inside the code, create an abstract class which is publicly available to allow for plugin extensibility. <strong>Chosen</strong><br>
  This solution was chosen ahead of interface only because it enables basic implementation (handy in this case). It was chosen ahead of abstract class only because it enables mocking within the code. The composition frameworks are excellent, but a bit over the top for something as lightweight as this application where only limited extensibility is desired.</p>
  
  <p><strong>Solution D:</strong> <a href="https://stackoverflow.com/users/565043/jay">Jay</a> and <a href="https://stackoverflow.com/users/571563/chris-shain">Chris Shain</a><br>
  Implement a composition framework (such as <a href="http://mef.codeplex.com/" rel="nofollow noreferrer">Managed Extensibility Framework(MEF)</a>) and build around it</p>
  
  <p>If any new solutions appear, i will add them to this list. The answer will go to the person who is best able to <strong>justify their solution</strong> (possibly with advantages and limitation)</p>
  
  <p>Thanks in advance,<br>
  Tech Test Dude</p>