Custom Plugins for an app?
Hello guys,
I am trying to figure out an easy way to add custom plugins for the app for additional features, without people having to download a whole new update each time.
either by DLL? or what?
Any ideas would be great.
i guess the way i'd want it to work is,
the program will auto detect the plugin file. Then, add's a specific value to either a button array, or add's a picture, etc.
Once that button is clicked, it will open a new form designed the way i want it. from within the plugin itself.
So its a module.
What would be the easiest way to do this?
Re: Custom Plugins for an app?
This is an oft-discussed topic concerning the use of interfaces. You would create a DLL that defines an interface for any class that wants to be a plugin for your app, e.g.
vb.net Code:
Public Interface IPlugin
Sub DoStuff()
End Interface
You would obviously add whatever members your plugins needed for the app to interact with them. Anyone who now wants to create a plugin for your app would download the DLL containing the interface and create their own DLL project that references it and defines a class that implements the interface.
Your app will then most likely have a folder specifically for plugins. At run time your app will use reflection to load each DLL in that folder and query it for types that implement your IPlugin interface. It can then interact with those classes to through the members of that interface to provide extended functionality.
If you search the web for something like plugin architecture .net then you'll likely find various blogs and the like that will go into more detail.
That's the way it has historically been done and can still be done if you desire. It's also worth noting that, from version 3.5, the .NET Framework includes an architecture for creating extensible applications. For more info on that:
http://msdn.microsoft.com/en-us/library/bb788290.aspx
Re: Custom Plugins for an app?