G
Guest
Ok, I now have an application with plugins that can talk to it via a service
container. The next thing I'd like to be able to do is have the plugins be
able to pass data to each other through the main application (which will be
logging everything that gets passed between the plugins). I was thinking
that they could do this just by passing their data object along with its type
to a function in the main app, which could then pass it on to any plugin that
can handle that type of data. Here's where I'm running into trouble...
I need to have a way for the plugins to tell the main application what kinds
of data they can handle. Presumeably they would only handle types that
existing plugins create, and therefore the plugin developer would know about
them and know how to handle them. Once they tell the main app what they can
handle, the main app will know to pass that type of data on to them. Would
they just reference existing plugins and therefore gain access to their types
and be able to pass them to the main app to tell it that they can handle
those type? Any other ideas on how I should do this? Thanks!
container. The next thing I'd like to be able to do is have the plugins be
able to pass data to each other through the main application (which will be
logging everything that gets passed between the plugins). I was thinking
that they could do this just by passing their data object along with its type
to a function in the main app, which could then pass it on to any plugin that
can handle that type of data. Here's where I'm running into trouble...
I need to have a way for the plugins to tell the main application what kinds
of data they can handle. Presumeably they would only handle types that
existing plugins create, and therefore the plugin developer would know about
them and know how to handle them. Once they tell the main app what they can
handle, the main app will know to pass that type of data on to them. Would
they just reference existing plugins and therefore gain access to their types
and be able to pass them to the main app to tell it that they can handle
those type? Any other ideas on how I should do this? Thanks!