Reputation: 10427
Lately I have been playing around with the plugin framework provided by the Qt4 Framework, and it works perfectly. There is however one thing that I am unsure of.
In all the examples, the interfaces that were implemented (the actual plugin), had their source code available (the person implementing the interface has access to the interface source). This is not a problem, but what I would really like to do is to rather expose the interface via a shared library or something similar.
My aim is to give 3rd party developers only a shared library file, which they can then "import" (excuse the Java terminology) in their code to create plugins for the application. Something similar to just giving a .jar
file in Java which the developer can then import.
The reason behind this is not to hide the source code, as it is an open source project, but for simplicity sake. Also, the program is very dependant on the interfaces staying the way they are so that plugins from different 3rd parties can talk to each other. If they mess with the actual interfaces, it will fall apart.
I would appreciate any nudge in the correct direction.
Thanks!
Upvotes: 0
Views: 212
Reputation: 3852
C++ does not allow as much introspection as Java, therefore you cannot just ship "the binaries" and infer the interface from that. In C++ you need the textual description of the interface (the header files).
Someone who wants to develop a plugin for your application needs to have access to
Plugin developers will usually not mess with the provided header files (at least they should not), for the reason that you provided in your post.
Upvotes: 1