Plugins and DLL

Plugins and DLLs

The explicit registration works well when the client code:

  1. is aware of which classes are used;
  2. knows when they are used;

there are 2 cases in which this is not possible:

  • plugins
  • shared objects

In the case of plugins, they are called dynamically in well known portions of the main program, but the application doesn't know the concrete class that will be created, so it can't know which class actually to register.

More generally in these cases the actual classes used are known in runtime only and it is not possible to register them from the main client program.

This situation invalidates at all the possibility to successfully deserialize instances of classes defined in a plugin or dll .

The solution is the registration of classes directly from inside the plugins/dll exactly as seen for the pointers article.

Joomla templates by a4joomla