M
ME
I am developing a kind of plugin framework that I can use for several
applications I want to make. In order to identify individual plugins I am
currently doing something like the code below (example only. Note that the
host has a collection of IPlugin's from which to look for the ID.).
Obviously you can tell that each plugin object will have the overhead of the
ID. The question is, which consumes more overhead? A string object or a
GUID struct? Should I use a GUID instead?
Thanks,
Matt
public interface IPlugin
{
string ID
{
get;
}
}
public class TestPlugin : IPlugin
{
// used to identify this object through the host from another
object in THIS assembly
public static readonly string testPlugin =
"{80369426-3FA8-457e-A0DD-4D8399114088}";
// Used to identify this object through the host from another
object NOT in this assembly
Public string ID
{
get
{
return testPlugin;
}
}
}
applications I want to make. In order to identify individual plugins I am
currently doing something like the code below (example only. Note that the
host has a collection of IPlugin's from which to look for the ID.).
Obviously you can tell that each plugin object will have the overhead of the
ID. The question is, which consumes more overhead? A string object or a
GUID struct? Should I use a GUID instead?
Thanks,
Matt
public interface IPlugin
{
string ID
{
get;
}
}
public class TestPlugin : IPlugin
{
// used to identify this object through the host from another
object in THIS assembly
public static readonly string testPlugin =
"{80369426-3FA8-457e-A0DD-4D8399114088}";
// Used to identify this object through the host from another
object NOT in this assembly
Public string ID
{
get
{
return testPlugin;
}
}
}