BoulderBum
Programmer
Let's say I have an abstract base class:
BaseClass
Some subclasses down the inheritance tree pick up a common interface:
InterfaceClass
In my code, I'm hoping to use polymorphism to call common BaseClass functions, but at one point, I will need the capability provided by InterfaceClass.
My question is, should I have any problem casting from a BaseClass reference to an InterfaceClass when necessary?
I'm actively scrambling to redesign a project to do something like what's mentioned, but I want to avoid a roadblock if I become aware of potential problems.
BaseClass
Some subclasses down the inheritance tree pick up a common interface:
InterfaceClass
In my code, I'm hoping to use polymorphism to call common BaseClass functions, but at one point, I will need the capability provided by InterfaceClass.
My question is, should I have any problem casting from a BaseClass reference to an InterfaceClass when necessary?
I'm actively scrambling to redesign a project to do something like what's mentioned, but I want to avoid a roadblock if I become aware of potential problems.