ResourceBundle vs. Interface
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vik_Kat
Posted On:   Friday, July 26, 2002 09:22 AM

Hi, everybody I am looking at internationalization of my project and I am thinking about creating an interface like this: interface IBundle{ public String getMyFirstMessage(); public String getMySecondMessage(); public String getMyThirdMessage(); ... } instead of using ResourceBundle. In my opinion it will significally improve performance and I don't see any downside in this. Can anybody tell me what can be wrong with this solution and what may be an advantage to use ResourceBundle. Thanks.    More>>

Hi, everybody



I am looking at internationalization of my project and I am thinking about creating an interface like this:



interface IBundle{

public String getMyFirstMessage();

public String getMySecondMessage();

public String getMyThirdMessage();

...

}



instead of using ResourceBundle. In my opinion it will significally improve performance and I don't see any downside in this.



Can anybody tell me what can be wrong with this solution and what may be an advantage to use ResourceBundle.


Thanks.

   <<Less

Re: ResourceBundle vs. Interface

Posted By:   Joe_Cheng  
Posted On:   Saturday, July 27, 2002 10:40 AM

Can't you get much the same performance benefit by subclassing ResourceBundle? I haven't worked much with i18n but according to the javadoc for ResourceBundle, one way to use it is to provide your own subclass, in which case the only difference between the ResourceBundle interface and yours is that you'll have one method for each resource.

If you're asking what's the advantage of using the property file method, I think the key benefit is that you can change the content independent of the code. Most production environments treat content changes differently than code changes (i.e. you have to do more testing for code changes), so it's an advantage to be able to just make some changes in a property file if you have a typo or something.

About | Sitemap | Contact