| Message Bundles | |
| Description This is a description of the new message bundle format story for Eclipse. Summary of the new format:
When creating a new message:
|
|
| Performance | |
| Time
The code is faster since accessing the messages is just a field access rather than a lookup in the resource bundle. Our performance results indicate the time to load and initialize bundle are VM dependant but are 5% to 46% faster using the new mechanism.
|
|
| Memory Footprint
With the new mechanism, the rough space savings is 88 + 5N per message where N is the length of the keys. We have calculated in the best-case scenerio for the Eclipse SDK if every key in every properties file was referenced, then the savings would be roughly 4.5M. (based on the January 11, 2005 integration build)
|
|
Other benefits
|
|
Drawbacks
|
|
| File Formats | |
Client Code Old Code:
New Code:
|
|
Messages.java Old Code:
New Code:
|
|
messages.properties Old Code:
New Code:
|
|
| Tools | |
| Conversion We have written a tool which aids in converting from the basic Java resource bundle look-up mechanism, to the new format. Note that the message bundle access class is replaced when the tool is run. If you define extra code, constants, etc in that class then please read the notes below to ensure that you don't have problems. Here are the steps to use when converting your code.
Notes: When using the NLS tooling from previous Eclipse releases, the java file
which was created had the format of the "old" Messages.java
file as described above. (basic class with Essentially what you want to do is get your java file into the basic template form. This is possible via using existing refactorings. For instance, if your class defines a method like this:
Then you want to do the following:
| |