calling functions over client server connection
i am currently sending an object between client and server that contains getters that have string variables that are evaluated by a large if statement in the reciever. i was wondering if it is possible to do this a simpler way rather than having a large if statement for all fo the possibilities that are contained in the object.getAction.
ie:
client sends object to server where getAction() = count
server receives object and evaluates the getAction() in a large if statement like so
if object.getAction()=="hi"
hi();
else if object.getAction()=="hello"
that();
else if object.getAction()=="count"
count();
else if object.getAction()=="multiply"
multiply();
is there a simpler and quicker way to do this? i have thought of ways that would just allow a direct calling of a function on the server or client side but i don't see how it would be possible.
something like this...
String function = object.getAction()
function(); -- where function is the string variable it receives from getAtion();
I know it is not possible to call a function from a variable, but that was my idea. any input or ideas wold be helpful.

