I have a requirement where I need to dynamically call services based on the Input value
Say - if we receive
- Input A- Call Service X and Service Y
- Input B- Call service Y and Service Z
- Input C- call Service Z
Now this list can change, so I am thinking of keepting this list in property file and then loading this at runtime and storing it in a Map
I will have Switch case statement to handle the service invocation like -
- If the Input is A then get the service list from the loaded Map
- Iterate and call the invokeMethod(Service IDentifier)
- invokeMethod will have the switch case
switch (service name) {
case "X":
callServiceX;
break;
case "Y":
callServiceY;
break;
case "Z":
callServiceZ;
break;
default:
break;
}
Please let me know if there is any other suggestions to improve the above process