O
Olie
I was quite surprised to find virtually nothing about this but I may
have been searching for the wrong thing.
I want to know the best way to provide a programming interface to a
plugin. I already have a plugin architecture that allows the
application to call code in a plugin but I want the plugin to also be
able to call code in the application.
I can think of many ways to do this but I am not sure the best way:
Option 1:
The plugin inherits a class that has one function called
GetInterface(), This returns a reference that can be cast to different
Interface types.
Option 2:
The plugin is passed a reference to the application interface which
contains all the callable functions.
Option 3:
The plugin can create an object that has all the API functions in it
e.g. Stop, Pause and Play. (The problem with this is how do you
actually connect those functions back to the main application.) I
suppose this would be similar to the office api or activeX interfaces.
I want to choose the best way that will also allow me to update the
API without breaking any existing plugins.
Any advice is welcomed!
have been searching for the wrong thing.
I want to know the best way to provide a programming interface to a
plugin. I already have a plugin architecture that allows the
application to call code in a plugin but I want the plugin to also be
able to call code in the application.
I can think of many ways to do this but I am not sure the best way:
Option 1:
The plugin inherits a class that has one function called
GetInterface(), This returns a reference that can be cast to different
Interface types.
Option 2:
The plugin is passed a reference to the application interface which
contains all the callable functions.
Option 3:
The plugin can create an object that has all the API functions in it
e.g. Stop, Pause and Play. (The problem with this is how do you
actually connect those functions back to the main application.) I
suppose this would be similar to the office api or activeX interfaces.
I want to choose the best way that will also allow me to update the
API without breaking any existing plugins.
Any advice is welcomed!