Vladimir R. Bossicard wrote:
String classname;
String class = message.get(MESSAGE_PARAM);

if (message.indexOf(".") == -1)
     classname = "org.apache.xindice.server.rpc.messages." +
         class; // the package might be encoded in a static string...
else
     classname = class;


Well... ugly indeed. :-)

But you have answered my question: the 'class' variable can contain a
fully-qualified classpath (with package).

Wait, don't take my word for it, I've never really used XML-RPC. But from the code that follows (a Class.forName()) I don't see why it shouldn't work.

In that case, let's change our own code and add 'org.apache.xindice.server.rpc' when we use a message's name. This will give our users the freedom to define their own messages and doesn't bother us too much (couple of query-replace)

Better yet: let's move all the message names to static final Strings somewhere, so that we gain a small point in performance and a huge one in cleanliness. How about it?


Ciao,

--
Gianugo Rabellino



Reply via email to