The technique you're using is related to the Factory Pattern. It's quite an established idea.
Note that the hint to avoid hard-coding (parts of) the class name is good.
In reply to Re^3: converting to a sub-class
by rhesa
in thread converting to a sub-class
by Cagao
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |