[jsword-devel] monster check-in

Joe Walker joe at eireneh.com
Sun Jun 13 15:01:41 MST 2004


DM Smith wrote:
 > Joe wrote:
>> The question is 3 fold. Style, Scope and Positioning
>>
>> Style: The resource names are LIKE_CONSTANTS because I wrote a couple of
>> vi macros to do the work and only going that far made things easy. 
>> However by including the class name in the lookup where resources are
>> package scoped we have a mix of scopings. And on the scope front ...
> 
> I think that whatever style is adopted it should be applied 
> consistently. Either all UPPERCASE with _ separating words or MixedCase, 
> like class names. The former does convey the constant nature of the 
> resource. The latter is in line with all the examples and Sun's 
> recommendations.
> 
> It does not matter to me which is chosen, as long as it is consistent.

I think MixedCase.WithDots is a better style. I am a little dubious 
about using class names because as you noted there is some sharing 
between classes and we seem to be at the conclusion that package scope 
is better for i18n resources.
But like you I'm not that bothered, and consistency is more important.

>> Scope: 

[Lots deleted]
My vote also is to leave the i18n resources scoped by package, and most 
other things scoped by class.

>> Positioning: The resource files were originally stored in a separate
>> directory because we didn't have CWClassLoader and wanted to be able to
>> override resource files with files placed in ~/.jsword. Now that we have
>> a cool ClassLoader maybe we should move the resource files into the java
>> source tree, and have them properly package/directory based rather than
>> package/filename based as at the moment?
> 
> 
> As you noted CWClassLoader allows for resources to be practically 
> anywhere. It allows a programmer to override them by putting them in 
> ~/.jsword, a file with a dotted package name (anywhere along the 
> classpath) or as Java originally intended, in their package.
> 
> When we were building a separate resource.jar, I thought it made sense 
> to have them in a resource directory. But since we have merged that into 
> a single jar per Eclipse project and since we are getting more and more 
> property files, I think it makes more sense to have them in their proper 
> directory. However, I will defer to Joe as he has to do the work!

So I think we can gradually move the resource files out of the resources 
directory and into the main class trees where they will sit alongside 
the classes/packages that use them.

Joe.




More information about the jsword-devel mailing list