开发者

Basic MEF workflow/usage

开发者 https://www.devze.com 2022-12-11 03:24 出处:网络
I\'m looking to a framework which will allow me to have a simple plugin system in my .NET application. I开发者_高级运维t seems MEF is the framework which Microsoft is endorsing, and will become part o

I'm looking to a framework which will allow me to have a simple plugin system in my .NET application. I开发者_高级运维t seems MEF is the framework which Microsoft is endorsing, and will become part of .NET 4 (it also seems to work with older .NET versions as a separate library, as well as Mono).

I'm previously used Mono.Addins as for a plugin system for a different project. The basic idea is I define a set of interfaces, these become "extension points", a plugin API if you will for the application.

Can MEF be used in a similar manner? How can I get started with MEF, especially from the perspective of someone with experience with Mono.Addins?


Yes, and I posted an example of how to do what you're talking about with MEF in a CodeProject article: Building an Extensible Application with MEF, WPF, and MVVM


Have you looked at the MEF CodePlex Site? The Programming Guide there is a pretty good place to get started.


Will an IOC utility work for your needs? I've found autofac really straight forward.

0

精彩评论

暂无评论...
验证码 换一张
取 消