Hey guys,
I'm trying to implement an interface from a mobile application and am wondering if the Front Controller
pattern is the correct way to do this.
The interface I have to the mobile application is a single
java method;
public
String sendAndReceive(String methodName, String parameters)
...the parameters are passed in as a JSON object.
The goal is for me to take the method name and JSON parameters, translate them into a call to a back end system and translate the return into a JSON object for consumption by the mobile application.
There are roughly 60 different method calls that the mobile application could make. I need to figure out the best way to invoke the appropriate logic as was thinking the FrontController pattern would be best placed for this - using a dispatcher to do the mapping of methodName to classes which would manage the invocation of the method.
My concern is that I'm going to have 60 different classes (and a big dispatcher method with lots of if else constructs!) if I do this.
Any thoughts?
Bic