In general, one could see it as an anti-pattern, as the separate methods are simpler and more explicit. However, some contexts may change this opinion. Two examples:
Front Controller
All Front Controller
patterns work like this (Struts or later) : the call is made to a centralized method, with parameters ; it is later dispatched to the correct handler (identified by one of the parameters). The point here is to apply a common code before (and after, possibly for exceptions) many specific codes.
The problem is not that this type of code executes, but to have this in your own code. If it is in framework code (already written, well tested etc), it's fine.
Examples are all the interception technologies, like Spring ..
Command
The Command
pattern may be pretty close :
- an identifier could identify a command to execute ;
- then you locate the correct code : in the command pattern, it's an object, so you can use a map to find the object that corresponds to the identifier
- execute the code : in the Command pattern, all these objects have a common method, so calling it is general, there is no need for a switch.