Using switch, and using if/else, are both signs that your code doesn't quite match your data.
That's a bit too general, don't you think? Without using switch or a bunch if-else statements, what does an event dispatcher look like? How do you implement a factory function?