1

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.

4

1 回答 1

0

几年前我也有过类似的选择,然后选择了 Prism。我很高兴我做到了。除非我正在构建一个微不足道的应用程序,否则我不会考虑在没有 Prism 的情况下这样做。您可以让不同的开发组在他们的模块上几乎孤立地工作,并在完成时将它们集成起来。错误和需求更改也是如此:更容易处理。

是的,您会希望每个人都使用相同的版本,但这是一个很小的代价并且很常见。如果您有具体问题,请告诉我。

于 2012-10-08T15:10:17.293 回答