开发者

Best practices for implementing an addin/addon/plugin strategy

My application should be extensible. For my own needs I have implement some services. These services are based on the IoC/DI princple. So the services encapsulate the concept of the application.

For exsample, there are an IApplicationService. The ApplicationService exposes information about the current exceuting application. There are specified the AssemblyInfo and so forth. An other exsample is the INavigationService(see mef.codeplexcom in the samples). This services provides some properties where are information about the current selected item specified and also some events.

I think, that the "service approach" is the easiest and simplifies the extension point开发者_高级运维s for the application. So, I am not sure that this is really the best approach. What do you think? How do you would implement "extensions points" in an application like addins/addons/plugins ... ?

Thanks in advance for your replies! And sorry, my english is poor. ;)


Are you familiar with MEF (Managed Extensibility Framework)?

The Managed Extensibility Framework (or MEF for short) simplifies the creation of extensible applications. MEF offers discovery and composition capabilities that you can leverage to load application extensions.


You seriously need to look at MEF - the Managed Extensibility Framework.

  • Managed Extensibility Framework Overview
  • Building Composable Apps in .NET 4 with the Managed Extensibility Framework
  • MEF on Codeplex

It's a great new framework that Microsoft itself is using in e.g. Visual Studio 2010 for its extensibility story. Great and easy to use - why reinvent the wheel when you can use something that thousands of dev will use shortly??


Yes, I am familiar with MEF. I also use the concept of MEF, but there some disadvantages. My application is IoC/DI like and together with MEF is a bit complicated. MEF is not really a DI container so to use MEF with an other DI container(e.g. ninject, unity, ...) is difficult to implment this. I won't to use MEF with other DI containers. So to mix MEF with other DI containers is not really good.

I hope you can understand my concern.

Addition: It is not possible to load extensions in to an AppDomain in MEF. So this is for my needs not good. System.AddIn or MAF supports this, but I won't use System.AddIn, because this is very heavy ... .

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜