Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prism - Bad idea to use it?

Tags:

wpf

mef

prism

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.

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.

like image 904
TrialAndError Avatar asked Aug 27 '12 13:08

TrialAndError


1 Answers

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.

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.

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.

You could pick an alternative framework, they all have their strengths and weaknesses.

  • Alternatives to Prism + MEF for modular MVVM apps

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.

  • http://www.matthidinger.com/archive/2008/10/12/managed-addin-framework-system.addin-with-wpf.aspx

Someone has come up with a framework that uses MEF here:

  • http://www.codeproject.com/Articles/43625/Building-an-Extensible-Application-with-MEF-WPF-an

If you want to look at an Enterprise size project with their own very plugable/modular architecture then look at SharpDevelop for inspiration.

  • http://www.icsharpcode.net/OpenSource/SD/

....and it's not beyond the bounds of possibility, if you really want, to combine the best bits from several frameworks.

like image 157
CSmith Avatar answered Nov 07 '22 06:11

CSmith