I have been migrating from Windows Forms to WPF and am trying to utilize Prism to meet the requirement that the application be plug-in oriented.
我一直在从Windows窗体迁移到WPF,并且正在尝试利用Prism来满足应用程序以插件为导向的要求。
My problem is that there is seemingly no support for it. I have also heard that it is extremely leaky in some cases. Being I am developing an enterprise application, this is unacceptable.
我的问题是似乎没有对它的支持。我也听说在某些情况下它非常漏水。由于我正在开发企业应用程序,这是不可接受的。
If this is the case, and it is a bad idea to start using Prism, is there any alternatives to make a composite application? Solely using MEF is all I can think of.
如果是这种情况,并且开始使用Prism是一个坏主意,有没有其他方法可以制作复合应用程序?我只能想到使用MEF。
1 个解决方案
#1
5
With Prism you have the option to use Unity and/or MEF as the IoC/DI framework....it's also quite extensible...so you can plugin different IoC containers if you wish.
使用Prism,你可以选择使用Unity和/或MEF作为IoC / DI框架....它也是可扩展的...所以如果你愿意,你可以插入不同的IoC容器。
Some of the problems with leaks can usually come down to not using WPF in a certain way e.g. need to use Weak delegates / Weak event patterns, etc.
泄漏的一些问题通常可归结为不以某种方式使用WPF,例如需要使用弱代理/弱事件模式等。
You could roll your own plug-in framework using MEF, but you'll probably need to re-invent some of the things Prism already does for you e.g. an EventAggregator, etc.
您可以使用MEF滚动自己的插件框架,但是您可能需要重新发明Prism已经为您做的一些事情,例如一个EventAggregator等
You could pick an alternative framework, they all have their strengths and weaknesses.
你可以选择一个替代框架,它们都有自己的优点和缺点。
- Alternatives to Prism + MEF for modular MVVM apps
用于模块化MVVM应用程序的Prism + MEF的替代品
There's another Microsoft technology that is geared to supporting plug-ins namely, System.AddIn/Managed Add-in Framework (MAF)....but you have to put in a bit more scaffolding.
还有另一种微软技术可以支持插件,即System.AddIn / Managed Add-in Framework(MAF)......但你必须加入更多的脚手架。
Someone has come up with a framework that uses MEF here:
有人在这里提出了一个使用MEF的框架:
If you want to look at an Enterprise size project with their own very plugable/modular architecture then you couldn't do worse than look at SharpDevelop for inspiration.
如果你想看一个具有自己的可插拔/模块化架构的企业规模项目,那么你不能比看SharpDevelop的灵感更糟糕。
....and it's not beyond the bounds of possibility, if you really want, to combine the best bits from several frameworks.
....如果你真的想要的话,它并没有超出可能性的范围来组合来自几个框架的最佳位。
#1
5
With Prism you have the option to use Unity and/or MEF as the IoC/DI framework....it's also quite extensible...so you can plugin different IoC containers if you wish.
使用Prism,你可以选择使用Unity和/或MEF作为IoC / DI框架....它也是可扩展的...所以如果你愿意,你可以插入不同的IoC容器。
Some of the problems with leaks can usually come down to not using WPF in a certain way e.g. need to use Weak delegates / Weak event patterns, etc.
泄漏的一些问题通常可归结为不以某种方式使用WPF,例如需要使用弱代理/弱事件模式等。
You could roll your own plug-in framework using MEF, but you'll probably need to re-invent some of the things Prism already does for you e.g. an EventAggregator, etc.
您可以使用MEF滚动自己的插件框架,但是您可能需要重新发明Prism已经为您做的一些事情,例如一个EventAggregator等
You could pick an alternative framework, they all have their strengths and weaknesses.
你可以选择一个替代框架,它们都有自己的优点和缺点。
- Alternatives to Prism + MEF for modular MVVM apps
用于模块化MVVM应用程序的Prism + MEF的替代品
There's another Microsoft technology that is geared to supporting plug-ins namely, System.AddIn/Managed Add-in Framework (MAF)....but you have to put in a bit more scaffolding.
还有另一种微软技术可以支持插件,即System.AddIn / Managed Add-in Framework(MAF)......但你必须加入更多的脚手架。
Someone has come up with a framework that uses MEF here:
有人在这里提出了一个使用MEF的框架:
If you want to look at an Enterprise size project with their own very plugable/modular architecture then you couldn't do worse than look at SharpDevelop for inspiration.
如果你想看一个具有自己的可插拔/模块化架构的企业规模项目,那么你不能比看SharpDevelop的灵感更糟糕。
....and it's not beyond the bounds of possibility, if you really want, to combine the best bits from several frameworks.
....如果你真的想要的话,它并没有超出可能性的范围来组合来自几个框架的最佳位。