Well, looking at this from a general perspective, what actually happens when you rely on polymorphism is that the compiler designs the switch case for you (or rather, uses the vtable to implement it). Now, what you can do to avoid the switch case (which would allow you to expand you set of classes in a more flexible manner) is to add yet another layer of classes, with the sole purpose of introducing polymorphism around this method. Not sure if that simplifies matters though...





Reply With Quote

Bookmarks