You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/12/04 23:11:27 UTC

DO NOT REPLY [Bug 37713] - [resources] Mesage API additions

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=37713>.
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=37713





------- Additional Comments From chris@absolutegiganten.org  2005-12-04 23:11 -------
(In reply to comment #0)
> I would like to propose the addition of two methods to the Message API. 
> Discussed in the following thread:
> http://www.mail-archive.com/commons-dev%40jakarta.apache.org/msg70528.html
> 
>   public boolean isResource();
>   public String getResourceName();
> 
> 1) The addition of an isResource() method might seem strage to a component 
> named resources, but messages can be either resource and non-resource. Adding 
> this would mean that software that handled both could use Commons Resource 
> Message interface for all its message requirements. For example Commons 
> Validator has the facility to be able to specify an actual message (i.e. non 
> Resource) or the key to a resource message in its XML configuration:
>    <msg key="error.date" resource="true"/>
>    <msg key="Date is invalid" resource="false"/>

The second example always felt strange to me. We are misusing the "key" member
and setting resource to false, puzzling. 

If we want to support such a use case I'd prefer to either rename the member to
some name which is applicable to both use cases or add another member (e.g.
"content") and ensure that only one of both members is set. 

> 
> 2) Adding the resource name would mean that MessageList could contain messages 
> from different Resources, rather than assuming they are all from the same one. 
> This feature has been requested in Struts a number of times.

+ 1. I like this addition.


-- 
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