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
请先登录再写评论。
You should read this information:
http://confluence.jetbrains.com/display/IDEADEV/Persisting+State+of+Components
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.
Keys are global, so using a prefix (e.g. your plugin "id") is a good approach.
Thanks for the answer! Is this news enough to add it to the confluence page on persistence?
Done ;-)
awesome! :-)