views:

1164

answers:

3

I'm fleshing out a WPF business application in my head and one thing that sparked my interest was how I should handle making it incredibly modular. For example, my main application would simply contain the basics to start the interface, load the modules, connect to the server, etc. These modules, in the form of class libraries, would contains their own logic and WPF windows. Modules could define their own resource dictionaries and all pull from the main application's resource dictionary for common brushes and such.

What's the best way to implement a system of this nature? How should the main interface be built so that the modules it loads can alter virtually any aspect of its user interface and logic?

I realize it's a fairly vague question, but I'm simply looking for general input and brainstorming.

Thanks!

+7  A: 

Check out Composite Client Application Guidance

The Composite Application Library is designed to help architects and developers achieve the following objectives:

Create a complex application from modules that can be built, assembled, and, optionally, deployed by independent teams using WPF or Silverlight.

Minimize cross-team dependencies and allow teams to specialize in different areas, such as user interface (UI) design, business logic implementation, and infrastructure code development.

Use an architecture that promotes reusability across independent teams.

Increase the quality of applications by abstracting common services that are available to all the teams.

Incrementally integrate new capabilities.

Gulzar
+1  A: 

Have a look at Prism

Enrico Campidoglio
Prism IS the "Composite Client Application Guidance" mentioned by Gulzar
Denis Vuyka
Denis: Both answers were posted at nearly the same time.
David Brown
+2  A: 

First of all you might be interested in SharpDevelop implementation. It is based on it's own addin system known as AddInTree. It is a separate project and can be used within your own solutions for free. Everything is split across different addins where addins are easily added/removed/configured by means of xml files. SharpDevelop is an open source project so you'll have a chance examining how the infrastructure is introduced, as well as service bus and cross-addin integrations. The core addin tree can be easily moved to WPF project without implications.

Next option is taking "Composite Client Application Guidance" (aka Prism, aka CompositeWPF) already mentioned earlier. You will get the Unity (Object builder) support out-of-box, Event Aggregation as well as the set of valuable design patterns implemented.

If you want to perform some low level design and architecture yourself the MEF will be the best choise (though working with all three I personally like this one). This is what VS 2010 will be based on so you might be sure the project won't lose support in future.

My advice is elaborating on these approaches and selecting the best and efficient one that perfectly suits your needs and the needs of your project.

Denis Vuyka