Modularity requirements

Topics: Prism v2 - WPF 3.5
Oct 6, 2009 at 12:26 PM

I am relatively new to Composite WPF.  I have an app that can use "plugins".  I am researching the feasibility on using the Modularity component, but I am wondering if it work properly.  My app actually has a WPF front-end, a WinForm front-end, and a Console App front-end.  So I need to be able to load the modules in all 3 front-ends.  I did a quick search of the "using" statements for Modularity and found 1 place where it seems dependent on WPF.  This is ModuleCatalog.cs.  Will I still be able to use Modularity in my WinForm and Console App front-end or is this design pattern implementation just for WPF/Silverlight?


Oct 13, 2009 at 7:26 PM
Edited Oct 13, 2009 at 7:27 PM


You can use the modularity features in Prism in an application that is not related to WPF/Silverlight. In fact the Modularity namespace is in the Composite dll, and not the Composite.Presentation dll. This distinction was done because ideally you could reuse this feature in other platforms that are not specific to a particular Presentation framework (like WPF or Silverlight). Brian Noyes ported some of Prism's (V1) functionality to Winforms here (modularity is not one of the ported features).

If you feel comfortable with the approach taken by Prism for modularity you should go ahead an use it (take into account there is no support). If you end up with a working implementation it might also be useful for the community.

Please let me know if this helps.

Damian Schenkelman


Oct 14, 2009 at 11:09 AM

Thanks for the reply.  I will definitely give it a try.  I was only concerned because ModuleCatalog.cs, even though it is just in Composite.dll, uses "using System.Windows.Markup".  And from my understanding the System.Windows namespace is for WPF.   As I work more with WPF, I am finding it harder to keep a separation of WPF and what I would think should be non-WPF components.  Beside this Modularity component I see this also in defining a View Model component.  From my understanding, a well written View Model does not need to know about the View.  But View Models have to make use of things like ICommand and INotifyPropertyChange which are WPF concepts.

Again, I will give it try with writing a quick Command Prompt app.  It may just be that I still need to reference the appropriate WPF assembly.