Polymorphism isn't evil. Your API might be.
Polymorphism can be a great internal design and still be the wrong abstraction to expose through an API.
Read the articlePolymorphism can be a great internal design and still be the wrong abstraction to expose through an API.
Read the article