Loading dynamic modules

May 5, 2008 at 4:05 AM
Do you have any suggestion on how you would go about loading the dynamic modules from a database table instead of by directory or from App.config?
May 5, 2008 at 7:42 AM
Yes. If you look in our recent drop, you'll see we have added a quickstart that illustrates loading modules on demand. You can use this approach to load modules from a database.
May 5, 2008 at 1:30 PM
planefun, I have the same concern, though I doubt this problem will be addressed by the Prism team due to differences in DB environments.

gblock, would a sample DatabaseModuleEnumerator implementation be a welcome submission to PrismContrib?
May 5, 2008 at 5:04 PM
Edited May 5, 2008 at 5:04 PM

Yes, we won't address the DB version. Putting in contrib is a wonderful idea. I will add you as a developer.

May 6, 2008 at 9:05 AM
Hi , what is the containers’(Unity) responsibility and what is the frameworks(Prism) responsibility when it comes to dynamically loading of modules?

May 8, 2008 at 7:26 AM
@chrisire The "framework" uses an IModuleLoader and IModuleEnumerator service. The IModuleEnumerator is responsible for returning metadata for each module (the IModule typenames). The IModuleLoader then loads the modules and calls their initialize. Within the ModuleLoader implementations, the IPrismContainer (which is a wrapper over any container) is used to resolve each module. This allows the contianer to inject any necessary dependencies into the Module when it is constructed. Again, this is not dependent on Unity.