You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Campbell, Justin" <jc...@profilesys.com> on 2004/02/12 02:36:40 UTC

RE: [veltools] recommended keys for MessageTool/ActionMessagesToo l

Stressing short, descriptive mnemonics... I feel like I'm in college again.
+1

-----Original Message-----
From: Nathan Bubna [mailto:nathan@esha.com]
Sent: Wednesday, February 11, 2004 2:38 PM
To: Velocity Users List
Subject: [veltools] recommended keys for MessageTool/ActionMessagesTool


hey folks,

i've brought this question up once before, but i can't help but try once
more.
:)

Right now, we recommend that people use "$msg" as the context key for the
MessageTool and "$actionmsgs" as the context key for the ActionMessagesTool

frankly, i'm not comfortable either one.  the MessageTool is designed to
support the i18n of text displayed in the webapp.  the ActionMessagesTool is
for displaying messages sent/created by Struts actions.  i've always felt
this
naming (which comes largely from Struts) was confusing and unclear.  while
it
is pretty much too late to try and get Struts to drop the language of
"message
resources" in favor of "text resources", and thus not worthwhile to change
the
java class names of these tools.  i do not think it is too late to change
how
we name them in templates.  i think we could make their purposes more
distinct
and clear by changing the recommended keys.  here are my reasons and
suggestions:

while $actionmsgs is functionally descriptive, it is ugly and on the long
side
for a standard tool.  it is also not parallel to $errors while the functions
of those two tools are parallel.  i think it would be clearer and more
elegant
to change this recommendation to:  $messages

$msg on the other hand is only descriptive of the underlying java classes,
not
the true function of the tool.  since the tool is just used to display
internationlized text, i think an appropriate key would be:  $text

please note that these are only the *recommended* keys and users are welcome
to keep their current naming schemes.

my reason for bringing this up now is that we are drawing close to a 1.1 rc
or
final release.  this would be the official introduction of the
ActionMessagesTool, and thus it is best to settle this matter before the
release.  also, after 1.1, i hope to put more effort into building standard
velocimacro libraries to accompany the tools.  at that point, the
recommended
keys become standards and changing them would be *very* difficult.  the time
to decide this is now.

oh, and since this is really a matter of how VelocityTools is used, i'm very
interested in hearing from everyone using these, not just contributors and
committers.

Nathan Bubna
nathan@esha.com


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

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