This is a design question.
In general, is it better to have many servlets each specializing in one function or have one big servlet that multiplexes to many different function?
I do know that in general the servlet itself should not contain the business logic for the function but delegates to other classes.
If we use the one servlet approach, seems like we have to write a big if-elseif statement to determine which business logic class gets what. Would this be difficult to maintain? So if we have more logic to add, we would have to rewrite the servlet code.
In general, is it better to have many servlets each specializing in one function or have one big servlet that multiplexes to many different function?
I do know that in general the servlet itself should not contain the business logic for the function but delegates to other classes.
If we use the one servlet approach, seems like we have to write a big if-elseif statement to determine which business logic class gets what. Would this be difficult to maintain? So if we have more logic to add, we would have to rewrite the servlet code.