简体   繁体   中英

WPF Composite Application: Prism modules or MEF parts?

I need to write a composite WPF application with parts being potentially developed by other teams. These parts are actually indepndent applications now, and we want to put them under common "roof".

Two main options I consider for composition is Prism modules vs. MEF parts, and I am not 100% sure which to choose, since both have pros and cons. Note, that this is NOT about the IoC container choice, this is about discovering pluggable components. I am pretty much settled on the opinion that MEF is not to be used as an IoC container.

If I go with MEF for pluggability, the biggest plus is that it is baked in into the .NET framework, so there are no versioning issues. From the other hand, I will have to (partialy) reinvent mechanisms such as Prism region managers and other UI composition features.

If I go with Prism modules, I get much richer integration functionality (regions, event aggregator, etc.), but for that to work everyone must be on the same version of Prism, and preferrably the same version of Unity, to avoid unpleasant surprises. Upgrading to a next version of Prism/Unity will thus become a challenge.

I would like to hear your opinion about the choice.

I had a similar choice several years ago and choose Prism. I'm glad that I did. Unless I was building a trivial app, I wouldn't consider doing it without Prism. You can have different dev groups work in near isolation on their modules and integrate them when complete. The same goes for bugs and requirement changes: much easier to handle.

Yes, you'll want everyone working on the same version, but that's a small price to pay and very common. If you have specific questions, let me know.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM