Thanks.
No I really mean an implementation of default behavior.With default plugin, do you mean the interface?
My problem is not the fact that I have to link to the interface - that is clear - rather, that I wanted each plugin to extend the default behavior of the "default" plugin.
But my problem was in part based on my "thinking mode".
I have thought a bit further, and came up with the following solution:
I will embed the "default" behavior in the application, and have the plugin interface not derive from that class, but only supply the extended/different functionality.
Then, in my application I can check for plugins, and if found create an instance and asign it to a member, on which I can then call the extended functionality.
Something like this:
Qt Code:
//Main app void MyDefaultClass::work() { //... common work for all plugins (therefore no need to be in the plugin) if(m_pPlugin)//initialized at app startup { m_pPlugin->particularWork(); } else this->paricularWork(); //... more common work }To copy to clipboard, switch view to plain text mode
This may seem trivial now, but at first I thought to have all the work done in each plugin - in other words - I was thinking about a fully functional units before - and none in the application which would just call the plugins, instead of just putting the differences in the plugins, and the common work in the application.
This allows each pluin to be free of extenal dependencies, and at the same time, deliver the specific behavior.
I still need to see if on implementation detail level, this is doable, or do my plugins need stuff from the "default" class, and if so, how can I solve it...
Bookmarks