You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "David W. Van Couvering" <Da...@Sun.COM> on 2005/08/31 22:07:58 UTC
Sharing messages
Hi, all. I am discovering that a lot of messages in the network client
driver are very similar to messages generated by the embedded driver.
Things like "Invalid parameter value ''{0}'' for
ResultSet.setFetchSize(int rows)." and "Negative or zero position
argument ''{0}'' passed in a Blob or Clob method." just as examples.
The simple thing to do of course is to have separate messages for the
network client. But this would mean that these pretty much duplicated
messages would require duplicated translations as well, adding
unnecessary work to the translation effort. The problem with sharing
messages, however, is that the engine's messages.properties file is
split up into multiple files; as I understand it, this is done in order
to reduce bloat of the engine image -- only the minimum number of
messages are loaded if an exception occurs, rather than all of them. As
a result I would need to copy the engine infrastructure that loads these
multiple resource files into the client area. More code duplication.
Any thoughts on this? Barring any feedback, I will probably copy
messages with their translations so at least I'm not compounding the
work for message translation.
Thanks,
David
Re: Sharing messages
Posted by Daniel John Debrunner <dj...@debrunners.com>.
David W. Van Couvering wrote:
> Hi, all. I am discovering that a lot of messages in the network client
> driver are very similar to messages generated by the embedded driver.
> Things like "Invalid parameter value ''{0}'' for
> ResultSet.setFetchSize(int rows)." and "Negative or zero position
> argument ''{0}'' passed in a Blob or Clob method." just as examples.
>
> The simple thing to do of course is to have separate messages for the
> network client. But this would mean that these pretty much duplicated
> messages would require duplicated translations as well, adding
> unnecessary work to the translation effort. The problem with sharing
> messages, however, is that the engine's messages.properties file is
> split up into multiple files; as I understand it, this is done in order
> to reduce bloat of the engine image -- only the minimum number of
> messages are loaded if an exception occurs, rather than all of them. As
> a result I would need to copy the engine infrastructure that loads these
> multiple resource files into the client area. More code duplication.
>
> Any thoughts on this? Barring any feedback, I will probably copy
> messages with their translations so at least I'm not compounding the
> work for message translation.
Adding indirection almost always solves every problem :-) Think about
sharing at the source level, not always at the consumer level.
You can have a single *source* for messages that is used to generate the
required files for client and engine rather than assuming you have to
share the engine's message.properties file. In fact the engine's
message.properties is a source of the messages, not the actual format as
compiled/shipped.
A single source could also be used to generate the list of messages for
the documentation, along with explainations, didn't we discuss this already?
Dan.