I am working on a project to replace the resource management system (QuickTime Resource Manager on Mac and Windows), which is outdated, and I use the current model that Qt uses when data is extracted from the resource file using the key string.
For example, I may have an image in my resource file "HungryBear.png" stored in my resource file. Qt and my proposed system would get this in the manner depicted by psuedocode:
image = GetImageResource("BearPlugin/Images/HungryBear.png");
At this point it is clear what kind of image it is and where it can be found.
In our current system, we use numbers. Problems with numbers are what you need to look for a resource file (there can be many) to find out which image (or resource) it is.
An example of this:
oldActiveResourceFile = GetActiveResourceFile(); // think of a stack of resource files SetActiveResourceFile("BearPlugin"); image = GetImageResource(1); // Perhaps other resources are retrieved and other functions called // Possibly introduce problems by calling functions that change "Active Resource File" SetActiveResourceFile(oldActiveResourceFile);
The first method is what I saw on current systems that access the data of the resource file. I was told that C # and Java use it, I know what they do for strings with key-key, etc.
However, one of my colleagues expressed concern about changing the current system for using these number identifiers for the line identifiers that I propose. There seem to be many benefits, and they fix many of the problems we had with the current system. I want to have supporting documentation that the proposed system is better and desirable, so my question is this:
Do you know of any studies or discussions that show that using a string identifier (hierarchical) in your code is better than using an arbitrary number?
NOTES
java c # resources
Lyndsey ferguson
source share