title: MEF vs. Reflection
body: <p>I finally started toying around with MEF only to find it was less straightforward to solve my flagship problem.</p>
  
  <p><strong>Problem:</strong>
  I have a WCF service that relies on some custom algorithms each living in their own assemblies.  When a method is called, part of the request's data contract will identify which algorithms are needed.  For example class One and class Two each implement a NameFile() method while classes A and B each implement EncryptFile().</p>
  
  <p>One call to the service's WriteFile() may need to call Two.NameFile and A.EncryptFile, while another may need One.NameFile and B.EncryptFile.</p>
  
  <p><strong>Attempts:</strong>  MEF (I'm new to it) seemed a nice way to load up assemblies but what I've found so far seems as though I need to go through a number of steps to determine at runtime which of the available contract-meeting assemblies fits the need.  Plain Old Reflection seems to be a more straightforward way to decide and load when the specific need is only known during a call.</p>
  
  <p><strong>Question</strong>  Is MEF indeed more suited to other dynamic loading scenarios or is it just my MEF noobism?</p>
  
  <p>Thanks,</p>
  
  <p>John</p>