Hi guys,
When deriving classes from a base class, I often find myself to use an
enumeration
to keep track fo the derived object type. I set it at New().
(I am aware that using overrides I hardly need to keep track of the
derived types,
but there are situation where they need to be "sorted out". )
This way I do not have to use TypeOf when I need to determine the
type of the derived class (for instance when doing some iteration
on parent objects).
I find handy to use the enumeration and also have a suspect it
can be slightly faster than TypeOf.
I would like to hear your opinion on this practice.
-P
|