There have been a couple things I thought would be neat additions for the i18n side of our logging code. Basically, inheritance.

Say you have the following Messages.properties files in the classpath.

A  org/apache/openejb/Messages.properties
B  org/apache/openejb/core/Messages.properties
C  org/apache/openejb/core/stateless/Messages.properties

Then you have a class such as org.apache.openejb.core.stateless.StatelessContainer (note the package)

If that class referenced a message key "classNotFound" for example, the i18n code would look for the message first in Messages.properties C, then B, then A and so on until it found the required message.

This would allow better reuse of messages, more flexibility in where we put the Message.properties properties files, as well as the added bonus in that we no longer need to pass in the location of where our Message.properties file is like we do now -- we'd just use the class' package name.

The trick would be performance. On that regard we could unroll upfront and do no backwards walking during actual usage or we could backwards walk on demand and cache for future lookups. Maybe some other clever tricks we could do.

Thoughts?

-David

Reply via email to