1

In one of our Java EE environments we are able to encapsulate modules inside of java ear files and deploy them to our JBoss environment so that they will be picked up and made available to users. In the .Net world how would one go about implementing a similar functionality in the run-time environment? Is this where MEF comes in? Or would it be approached in a completely different way?

Any suggestions would be greatly appreciated.

Thanks,

S

scarpacci
  • 8,957
  • 16
  • 79
  • 144
  • Have a look at MEF first. Note that MEF is not a plugin framework. If it is not enough and you want a full blown plugin framework have a look at mono.addins – Panos Rontogiannis Apr 09 '13 at 10:25

1 Answers1

1

You can just compile them to a separate assembly. These module assemblies can be distributed separately from your main application.

When you're composing your objects in MEF, you can specify a DirectoryCatalog (or ApplicationCatalog) to include all modules from all assemblies in a given directory:

var catalog =  new DirectoryCatalog(".\modules");
var container =  new CompositionContainer(catalog);
p.s.w.g
  • 146,324
  • 30
  • 291
  • 331
  • Thanks p.s.w.g so does MEF then check for additions to items that show up in the catalog? – scarpacci Apr 08 '13 at 17:57
  • @scarpacci Do you mean dynamically [recomposing](http://mef.codeplex.com/wikipage?title=Recomposition) at run-time? I haven't tried it myself, but this like looks promising. – p.s.w.g Apr 08 '13 at 17:59