Plugin-based application. Best practices?
-
In a plugin-based application the core/executable has several pure virtual interface clases that plugins (dll/so) should implement. Further there are standard implementations of that interfaces, which should be accessible by the plugins.
Do I need to export pure virtual interfaces at all? I mean they consist only of header files which the libraries include anyway at compile time. So I should not need the symbol at runtime, should I?
How do I export variables and classes from the main application to the plugins? Does this make sense at all? What is the best practice for this case?
This means that these symbols should be undefined in the libraries. How do I achieve this?
-
Hi,
@manuelschneid3r said in Plugin-based application. Best practices?:Further there are standard implementations of that interfaces, which should be accessible by the plugins.
I don't follow, what standard implementations? The idea is that the app provides the recognized interfaces, while the plugins provide the implementations.
@manuelschneid3r said in Plugin-based application. Best practices?:
How do I export variables and classes from the main application to the plugins?
You don't. You "push" anything you need to the plugin from the main app through one of your interfaces (i.e. by a setter method or w/e).
@manuelschneid3r said in Plugin-based application. Best practices?:
Does this make sense at all?
No, not really.
@manuelschneid3r said in Plugin-based application. Best practices?:
This means that these symbols should be undefined in the libraries. How do I achieve this?
You can't link if you have "undefined symbols". So no, you don't achieve it, nor you need to. :)
-
Hi,
To add to @kshegunov, you might be interested by the Extending Qt Applications part of the Plugin HowTo in Qt's documentation.