Whenever I feel like choosing from a list of implementations I always prefer to fill a map first and then call whatever I need based on a parameter, instead of using switch or else if statements.
What is the pattern I'm looking for here? I've been told repeatedly that using maps is not the optimal solution for this, but I find writing those statements a bore.
I tagged the languages I'm currently working with, but this is not a language specific question.