Usually plugins will implement a common interface. An application using these plugins will download each plugin from the repository (for example, a library into a directory) and use a common interface to communicate with them. You can extend this so that plugins implement one or more of a set of common interfaces.
Difficulties include determining which interface to define will be useful not only now, but also for future plugins. You also need to worry about poorly written plugins. What happens if the plugin throws an exception? Or maybe if he stops responding. If you allow malicious plugins to crash your system, or you must be isolated from this.
source share