In my .NET application I allow people to add their plugins. However I’ve got several helper functions which will help them.
What’s the best way to provide access to these functions for plugins?
Shall I just add a new DLL to the project and put all helper methods / classes to there and tell plugin developers to link that DLL?
I’m currently designing this system, never developed a plugin system before, so don’t want to make a stupid decision.
I don’t think that there’s anything wrong with the approach of adding a DLL to the project and providing that as your ‘helper’ mechanism. However, keep in mind that you won’t really have any control over how they instantiate classes in your DLL, and all the inputs to all the functions will have to be checked to ensure that they are valid, not null, etc.
Another idea would be to provide an interface which has the helper functions (or even references of other helper interfaces) and pass that in to the plugin. That way you don’t have to worry about object creation, and the vector of how they would use the add-ins would be limited to what you expose in the interface.