commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37849] - [resources] Messages should implement Map
Date Fri, 09 Dec 2005 18:08:12 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37849>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37849





------- Additional Comments From craig.mcclanahan@sun.com  2005-12-09 19:08 -------
(In reply to comment #2)
> I'm against this proposal for two reasons:
> 
> * the main reason is I don't see how it is possible - we don't just retrieve 
> i18n messages based on a key - the Locale is needed as well.

A strategy that could make this work would be to have a method signature like
this on the factory:

    Map getMessages(Locale locale)

that would return a map already localized for the specified locale.

> 
> * secondly Map provides too much access - not only retrieving values but also 
> modifying and clearing the whole lot. Resources provides "read-only" access to 
> whatever it represents (e.g. properties files) and shouldn't either provide or 
> appear to provide a facility to modify them.

There's nothing stopping the returned implementation from throwing
UnsupportedOperationException on all the methods that modify things (like the
standard UnmodifiableMap wrapper does).

Maps would be especially handy in the context of EL expressions used to pull
individual messages by key out of the Messages object, since EL already knows
how to deal with maps.  This is the strategy that JSF uses, for example.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message