How can I avoid switch or chained ifs, if I don't want to subclass for design reasons? Specifically, in my model I have already a type hierarchy consisting of a few classes that implement an interface. The interface represents a relation between two nodes and the classes represent different types of relations. Another class that does SQL generation has a list of relations and wants to do different