asterics / AsTeRICS

The Assistive Technology Rapid Integration & Construction Set
http://www.asterics.eu
Other
57 stars 27 forks source link

Generic solution for enabling/disabling plugins #309

Open klues opened 5 years ago

klues commented 5 years ago

Often it makes sense to be able to enable or disable plugins at model runtime, e.g. enabling the ComPort plugin only if it is needed and preventing error messages at startup if the COM port is not available.

https://github.com/asterics/AsTeRICS/pull/295 implements enabling/disabling for the COM port plugin, https://github.com/asterics/AsTeRICS/pull/294 for the Averager plugin.

It would be great to implement a generic solution for enabling/disabling plugins so that it isn't necessary to implement it multiple times in multiple plugins. Some solutions could be:

  1. A complex solution for this could be to implement composition of bundle descriptors, so we could define generic functionality.
  2. A simple solution could be to create a plugin which allows to control the lifecycle and properties of any other plugin.
  3. define some generic functionality for enabling/disabling a plugin in a superclass DeactivatablePlugin and Plugins can derive from this class