The usual method for extending a class to add new functionality without having to change the class code is to create a subclass with new functions and variables that implement the new functionality.
However, if several people extend the same class with their own subclasses, it is difficult benefit from extensions developed by different people because their subclasses are separated.
This class implements a very innovative solution for extending a class using independent plug-in functions. It works by generating a new subclass that combines multiple functions that are defined in separate script files.
This way any developer may create a new class extension combining the functions defined by the plug-ins that they are interested, providing a more flexible and thus more powerful means of code reuse.
This class is meant to dynamically extend any object of a class with new plug-in functions or collections of functions that are defined in separate files or from variables.
It works by dynamically creating a new sub-class of the class of given object adding the plug-in functions that are specified at runtime.
The name of the loaded plugin functions are stored in the object to prevent loading the same plugin more than once, but you still can force a reload so a new plugin can replace an old one.