Please do, yourself a big favor, stop all of this activity. A switch statement by the type is something directly opposite to OOP
, a total abuse. Actually, roughly speaking, the main point of OOP was to avoid such things
Nothing can help you to fix your code, just because the whole idea is wrong. It just makes no sense. Also, I don't see a reason to explain you how OOP works. Read anything explaining OOP; and I hope you will see what to do. Or not.
OK, a hint: whatever you have under each case should be a virtual method overridden in each concrete (non-abstract) class. Then some method using it should be one line: a call to the same method of an abstract class, as a compile-time type
. As a run-time
will be some concrete type, the call will be dispatched to one of the overridden methods, through late binding.
If you already using the term "late binding", use late binding.
As one Easter proverb say, "Saying "halva-halva" won't make your mouth sweet".