[Opensim-dev] Module/Plugin Loading

Ryan McDougall sempuki1 at gmail.com
Wed Jun 25 22:55:34 UTC 2008


On Thu, Jun 26, 2008 at 4:08 AM, Michael Wright
<michaelwri22 at yahoo.co.uk> wrote:
> Yes those are great if we can acheive them. I'm just not sure how we create
> a "clean" wrapper that is independant of Mono.addins, as it uses various
> attributes to define the interfaces and plugins (TypeExtensionPoint,
> Extension, etc) . So those classes need references to mono.addins.

Those attributes are just syntactic sugar. Once you start really using
the features of Mono.Addins you're best of configuring your addins
with the XML file.

Its also worth nothing that there is nothing in Mono.Addin's XML
config file that replaces anything in OpenSim.ini, nor vice versa.
They are completely orthogonal configuration files which are
unrelated. There is no OpenSim v. Mono.Addins dilemma.

>
> So if we had more classes that used were loaded by mono.addins, we would
> need the interfaces to have a TypeExtensionPoint attribute and the
> implementations to have the Extension. Tthe only other way I saw for
> Mono.addings to load plugins without those attributes, is by using its xml
> manifest files. And one of our requirements is listed as that we don't use
> third party config files.

That sort of source-code creep doesn't happen, as you point out, when
you use the XML config.

> I most likely haven't dug deep enough into mono.addins and there could well
> be a method to do cut out the attributes and not require manifest files. But
> anyway my point is that I believe a implied effect of those requirements is
> that we don't have references to Mono.addins in the core opensim assemblys.
> (OpenSim.Framework.X , etc)
>

Let me give my opinion on the matter:

- There is a principle in both good engineering and open source: don't
reinvent the wheel. Plenty of people have written DLL loaders, and I
see no reason presented here why we should roll our own.

- Mono.Addins provides features that our custom jobbie doesn't. Maybe
those features aren't critical, but given that they come to us
pre-debugged, I fail to see how its a loss to accept them.

- There are two main sources of Addin loaders: Mono and .NET.
Mono.Addins was inherited from SharpDevelop and Eclipse -- a strong
pedigree. The .NET version is new as of 3.5 runtime, and not yet in
Mono. However, given how similar it looks to Mono.Addins, I wouldn't
be surprised if it wasn't lifted to a large degree from Mono.Addins
(which after all is MIT/X11 licensed).

- So long as mono only supports Mono.Addins, the only cross-platform
thing to do is use Mono.Addins. When Mono support System.Addin, we can
migrate to that.

http://msdn.microsoft.com/en-us/library/system.addin.aspx

Cheers,



More information about the Opensim-dev mailing list