Need to implement a requirement where the flow of code will be decided based on a lot of cases if implemented using switch case, OR a lot of if/else !
Sample code to be implemented:
if(flag='1')
Invoke a new route
else If(flag='2')
Invoke route2
.
.
.
.
else if(flag= 30)
Invoke route 30
Is there a better approach to write such cases other than if/else statements or switch cases??
Something which is similar to internal implementation of workflow engines like jBPM
but i actually cant include the workflow engine as it makes the application heavy!
Any suggestions appreciated!