Plugin Bootstrapping

How does a plugin come to life?

All plugins are housed in a .dll (windows). This .dll will have a different file extension (TBD) to differentiate it from normal .dll's but it is a .dll. We call this an assembly (,NET terminology)

Each assembly MUST have an plugin factory. This object will be created by the host and will create new instances of the plugins (!) that are housed inside this assembly. Yes, multiple plugin (types) can be located in the same assembly.

This plugin factory interface might look something like:
public interface IPluginFactory
    IEnumerable<IPluginInfo> PluginInfos { get; }
    IPlugin CreatePlugin(IPluginInfo pluginInfo, IPluginContext context, IPluginArgs args);

.NET specific

The plugin factory object is found by reflection based on the implementation of the IPluginFactory interface and it is then (when found) instantiated.

C++ specific

The C++ .dll must export the IPluginFactory* getPluginFactory() method from the .dll that provides an instance of the plugin factory object. Returning null will abort loading the plugin.

Last edited Oct 6, 2013 at 8:43 AM by obiwanjacobi, version 4