title: Prism - Unity equivalent of MEF functionality?
body: <p>I have a solution structured like so:</p>
  
  <ul>
  <li>Models assembly </li>
  <li>Data assembly -
  defines repository interfaces and a
  base repository class </li>
  <li>ORM assembly -
  implements repository interfaces &amp; inherits
  base repository class ^ </li>
  <li>Business
  assembly - has a reference to the
  data assembly, and dynamically pulls
  in the ORM object via MEF (no
  explicit reference to the ORM
  assembly) </li>
  <li>UI assembly(s)</li>
  </ul>
  
  <p>In this fashion, I can easily swap out the ORM, if we decide to go with something else.</p>
  
  <p>I'm curious if it's possible to have similar functionality with Unity. I want to decouple my business logic from the underlying ORM. From what I've read, unity mainly works at compile time and MEF is at runtime. That being said, is it possible to decouple with unity in such a way that my business layer has no reference to the ORM, but instead just the interfaces that it implements from the data assembly? How can Unity define what implements the interface without having a reference to the implementing assembly?</p>
  
  <p>Currently, with MEF, no assembly has a reference to the ORM (other than when the business layer dynamically pulls it in at runtime to discover parts and fill the interface with an object). I would prefer to continue working along these lines and would like to know if I can do that with Unity.</p>