[sldev] COM for plugins

moshe at sapwood.org moshe at sapwood.org
Fri Feb 16 10:39:47 PST 2007

I'm reading https://wiki.secondlife.com/wiki/Plugin_architecture for the
dylib plugin approach.

Any feelings on a COM-like interface instead of the function pointer
example? This has two advantages:

- The SL viewer can provide multiple interface versions
- The SL viewer can warn the user if he's using a plugin that will be
obsoleted at the next update

The first is less scary than it sounds. I'm not proposing something like
DirectX with its twelve year legacy interfaces, but rather 2-3 SL viewer
revisions, especially when the viewer hits a run of fast updates. A
versioned interface is useful when a function has been changed to take
different arguments, the flags going into a bitfield change, or an old
version of a function had a side-effect a plugin may rely on. It's trivial
to write thunking functions that translate calls between the old and new
calling convention or emulate old side-effects temporarily.

The second can be accomplished by a simple version comparison, based on
what the plugin requests and what the viewer supports. To be nice, the
viewer could even accept an URL from the plugin as part of the interface
request, then send users to a website to check for an updated version of
the plugin when the plugin is of a warned or denied version.

More information about the SLDev mailing list