I read both .net MEF (Managed Extensibility Framework) and MAF (System.AddIn) and I got confused by their online reviews.
While MEF seems newer and more attractive than MAF. I can't understand how we can link an extension with .NET application using MEF. For example, in MAF, I can develop my entire extension logic (AddIn) which involves:
- main dll, say X.dll
- all the dlls referenced by X.dll
- external resources that X.dll needs such as a database, some textfiles ... etc
then the Host can simply call a method inside X.dll and waits for the result.
On the other hand, MEF requires that all DLLs to be located in the same folder, say "Plugins", hence X.dll must be in "Plugins" in order to be discovered and linked, so my question how we can embed all the resources that X.dll requires to complete an incoming request from the host?
My real question is: if a team is to design a host application that its processing capabilities can be extended by relying on extensions developed by other teams or simply downloaded and installed from the internet, Is MEF an effective technology in such project? or should the team stick with MAF ?
P.S: My question is not about which one is better in terms of security ... etc. Instead I am more interested in finding out if MEF allows hooking up assemblies that require their own external resources to be available around the assembly, such as a spell checker extension which requires some corpus of text and a heuristics database, these two resources are required by the extension but not required by the host itself
Furthermore, in my former example if X.dll requires Y.dll to run, I cann't simply put both dlls in the "Plugins" folder, because y.dll is not an extension.