ResourceMap: Why are class' property file in a resources sub-package?

  10 posts   Feedicon  
Replies: 9 - Last Post: December 09, 2010 11:41
by: etf
showing 1 - 10 of 10
 
Posted: December 02, 2010 01:13 by farrukh_najmi
First kudos to Illya and team for breathing new life into SAF under BSAF. I was able to make the switch from SAF to BSAF with no code change at all! Thats awesome.

However, I do have one pre-existing issue that is causing me much trouble at present and am hoping we could fix BSAF for this if it makes sense.

The ResourceManager class says that:


Resources for a class are defined by an eponymous ResourceBundle in a resources subpackage.



I am wondering why it is this way instead of a class' property file being in the same package as the class?

Is the current practice of using a resources sub-package based on a good rationale?

This current practice is causing problems when using a code obfuscator as obfuscators typically expect a class xx.Foo to have a property file in xx/Foo.property and not xx/resources/Foo.properties. Thus obfuscated code involving BSAF fails currently.

If their is no good reason for the resources sub-package practice then can we consider keep resources in the same package as their class rather than the resources sub-package? This would require changing resource files around in existing projects but it seems like a minor price to pay for fixing the problem. Thoughts?
 
Posted: December 02, 2010 15:15 by farrukh_najmi
Would there be support from Illya and dev team if I did a patch that allowed ResourceManager to be configurable via a policy as to how it finds a class'es property file (either in same package or in "resources" sub-package)? The end result would be backward compatible. I would rather get some discussion on this before looking into a patch so I avoid wasted effort.

I have added the following issue to track this:

http://kenai.com/jira/browse/BSAF-108

 
Posted: December 02, 2010 23:55 by Eric Heumann
I definitely support implementing such a feature. I think one of BSAF's major drawbacks currently is the inability to make little customizations like this.
 
Posted: December 03, 2010 09:38 by jekkos
ok I like this one, go ahead and if I will have a look at it for sure .

grtz
 
Posted: December 03, 2010 16:06 by farrukh_najmi
Sounds good. I will try writing a patch for this. Does any one know where the "resources" sub-package convention originates from and what is the rationale for not keeping the resources in same package as class? This would be very useful information for me. Thanks.
 
Posted: December 04, 2010 19:28 by farrukh_najmi
A patch has been added to BSAF-108. Can some one from dev team tell me what to expect in terms of incorporating this in a release of BSAF. Thanks.
 
Posted: December 05, 2010 21:40 by Eric Heumann
I think the proposed patch is adequate for 1.9.x. But in the future, for the 2.x development, why just limit the options to the same directory or a "resources" subdirectory? What if I wanted to put the resources in a subdirectory named "res"? Or even further, what if I wanted to put resources for a specific class in a directory that wasn't a subdirectory of the directory containing the class file (e.g. I wanted the resource directory for that class to be relative to the root of the JAR file)? I hope these sorts of considerations are considered for the 2.x branch.

Eric
 
Posted: December 07, 2010 23:44 by farrukh_najmi
How does one figure out who is on the dev team. I have not see any page that lists dev team members for the project. Would it be possible for someone from dev team to let me know what to expect for planning purposes for a release that has this patch? Thanks.
 
Posted: December 08, 2010 09:05 by jekkos
I think at the moment the only one that is able to do commits is illya. So we should wait for his fiat here.

grtz
 
Posted: December 09, 2010 11:41 by etf
Sorry guys, I am on vacation now. Don't have any strong connection to Internet. Will be on duty soon.
showing 1 - 10 of 10
Replies: 9 - Last Post: December 09, 2010 11:41
by: etf
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close