#3 gave me a nervous twitch. Re-blessing objects is really cool, but evil.
I like #2 because the Company object doesn't have to deal with the lower subclasses at all. #1 is, perhaps, a better use of polymorphism.
----
: () { :|:& };:
Note: All code is untested, unless otherwise stated
In reply to Re: inheritance and object creation
by hardburn
in thread inheritance and object creation
by knew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |