S
Sid Price
Hello,
I have a problem trying to figure out the following design issue. I have a
base class and a number of classes derived from that base. A method in the
base class covers 90% of the functionality required for all classes, however
I need to have that 10% functionality that is left in the derived classes.
What I would like to do is have the method in the base class be able to call
the method in the derived classes, it should do this according to the actual
class that was instantiated.
For example: The base class is "bClass", and there are two derived classes
"Class1" and "Class2". The method "Test" in bClass needs to call
"OtherMethod" in either Class1 or Class2. If I instantiate an object of type
Class1 and call "Test" I need it to call "OtherMethod" in Class1. Can this
be done?
Thanks,
Sid.
I have a problem trying to figure out the following design issue. I have a
base class and a number of classes derived from that base. A method in the
base class covers 90% of the functionality required for all classes, however
I need to have that 10% functionality that is left in the derived classes.
What I would like to do is have the method in the base class be able to call
the method in the derived classes, it should do this according to the actual
class that was instantiated.
For example: The base class is "bClass", and there are two derived classes
"Class1" and "Class2". The method "Test" in bClass needs to call
"OtherMethod" in either Class1 or Class2. If I instantiate an object of type
Class1 and call "Test" I need it to call "OtherMethod" in Class1. Can this
be done?
Thanks,
Sid.