You can build out a plugin framework later in stages: i) derive interfaces ii) define your plugins with interfaces within the same project iii) load your internal plugins with a plugin loader class iv) finally, you can implement an external library loader. If you plan to open to third-parties in the future, don't make it a plugin architecture to start with. Even inversion of control is overkill in many situations. "Modular" means you are striving to adhere to SOLID principles, but that doesn't mean you need Plugin architecture.
#Sourcemod plugins backwards compatible software#
If you are building modular software that's great, use classes and namespaces (don't get carried away with interfaces). Riskier modules can be separated into another library and optionally excluded by end-users. Security grouping - Your core software might use trusted platform calls.You should not build your own scripting language, instead you should compiled the user c# code against a restrictive interface in an appdomain that is very restrictive (disabling reflection and others). This is a dream for many software projects, but you should wait until you have an interested third-party partner before doing the extra work to build the plugin framework. Source code would be better if that's an option, or if it's web-based, redirect to their URL. (Additional methods will be accessible through reflection - not that you would want to).Of course, only V1 methods and properties will be accessible from the plugin to the Main App.Main App will find and load the Person plugin and reference through a V1 definition for the IPerson interface.The main app folder will only contain the V1 plugin.
![sourcemod plugins backwards compatible sourcemod plugins backwards compatible](http://i.gyazo.com/7864416abcc24c6b352b4eb9924b6075.png)
The plugin folder will contain the V2 and V3 plugin.Person Plugin implements Plugins.V2.IPlugin and references the V3.So let's now take your case, main program older than plugin: You may need to have matching dlls for each version (each referencing the previous version(s)).
#Sourcemod plugins backwards compatible .dll#
dll will go even with this structural architecture of Interface versioning.
![sourcemod plugins backwards compatible sourcemod plugins backwards compatible](https://s2.studylib.net/store/data/018445745_1-91afda054edfd1d76385f2c79d8d3cad-768x994.png)
Your main application will reference the PluginAPI, and each plugin will reference the PluginAPI. First, Your PluginAPI (containing the interfaces) should be a separate DLL to your main application.