I would like to improve the conceptual architecture and modularity of my new software using C++ and Qt.
I was thinking to develop a "main application" and a set of "plugins" (shared libraries) to expand the "main application" features.
I already did a simple test of this:
1- I Build a custom shared library (I'm calling this a "plugin with UI")
2- I Build the main application that uses QPluginLoader class to load shared libraries
3- When the main application starts, it loads dynamically all "plugins" that are located in a specific folder.
4- All running good! It works!
So, my doubt is that I would like to each "plugin" can run alone too...like a standalone executable application. I would like to "double-click" on each plugin, or call it using the Terminal/Console...pass some input arguments...and get it running without the "main application".
If this is possible, my architecture will be based on develop each "plugin" like a "software segment" that is completely autonomous (like a executable)
BUT, if this plugin file is located inside a "plugins folder"... When the "main application" start, it will can load it dinamically too (like a shared library).
The feature of "load dinamicaly" is important to be able to create custom menus and internal options inside the "main application". And in the future, other people will develop new "plugins" to this "main application". So I can't "lock" this dynamic load feature.
Is there any way to "mix" this two file behaviors (executable and shared library)? How to do it?