Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


ID's for different systems/plugins ?

This topic is 5221 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey again Well, this might be a little stupid question but I'm actually having trouble to choose what kind of identification system to choose for my pluginarchitecture. I have a Single class that loads all the plugins and this class also creates objects from these plugins... so for creating an object from a loaded plugin goes just like the COM system with QueryInterface() ModuleManager->CreateObject("the id"); Now I'm not sure what kind of id to register my objects with. Should I let each of my plugins have a GetID() function and define an ID inside each DLL. But in that case The programmer not knowing anything about this plugin wont know what ID to pass to the CreateObject() function. Only the Creator of that Plugin would know the ID... It's things like that I cant decide... How have you guys done this? Would appreciate some examples [edited by - bilsa on April 6, 2004 6:46:26 AM]

Share this post

Link to post
Share on other sites
Personally I just use a string to identify plugins. Others use GUIDs or some sort of other random identifier, which is a Good Thing(tm) when the system will be widely distributed and have lots of people developing plugins, but a bit overkill if it''s just for yourself.

As for only the creator knowing the ID, that probably won''t be as big a deal as you think. Usually you WILL know the ID because you know you need that plugin (for example, a plugin that loads all files with the extension .map could have an ID "MapLoader" or something). In most situations where you don''t know the ID you''re usually asking the user to select the plugin from those available (which your ModuleManager should know no matter what), so in reality the user is telling you the ID.

If you still think you''ll have problems with not knowing the ID provide a bit more info about your design and a case where you think this would be a problem and we''ll give you a hand.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!