Should I prefix properties in PropertiesComponent?

Hello everyone,

I am coming from an Eclipse plugin background and I want to store some plugin-specific properties. As I see it http://git.jetbrains.org/?p=idea/community.git;a=blob;f=platform/core-api/src/com/intellij/ide/util/PropertiesComponent.java is the right choice for it.

It looks like the PropertiesComponent stores values globally, so should I prefix my keys ("MYPLUGIN_xxx") to avoid name clashes with other properties? Or is that unnecessary?

Regards,
Holger

6 comments
Comment actions Permalink

Thanks for the hint. I already read it, but I did not find information in there, whether the PropertiesComponent stores values globally, for all plugins or separately for each
plugin.

0
Comment actions Permalink

Keys are global, so using a prefix (e.g. your plugin "id") is a good approach.

0
Comment actions Permalink

Thanks for the answer! Is this news enough to add it to the confluence page on persistence?

0

Please sign in to leave a comment.