Hi just want to ask a design question in Spring MVC Controller. A request URL will have multiple parameters, eg. type=v1&par2=v2&par3=v3&par4=v4. Among the 4 parameters, 'type' will decide the transaction mode and the other parameters will be the input for each transaction.
How will you organize the controller code? Traditionally, you may write something like the following,
if (type.equals('1'))
{
callMode1(par2,par3, par4);
}
else if (type.equals('2')
{
callMode2(par2, par3, par4);
}
else if (type.equals('3'))
{
callMode3(par2, par3, par4);
}
callMode1 - callMode2 are private methods in the controller.
Just wondering if there is any better way to write the code here?
Thanks in advance!