I have a base class Base, which I declare as several polymorphic subclasses. Some of the functions of the base class are pure virtual, while others are used directly by the subclass.
(All this in C ++)
So for example:
class Base
{
protected:
float my_float;
public:
virtual void Function() = 0;
void SetFloat(float value){ my_float = value}
}
class subclass : public Base
{
void Function(){ std::cout<<"Hello, world!"<<std::endl; }
}
class subclass2 : public Base
{
void Function(){ std::cout<<"Hello, mars!"<<std::endl; }
}
So, as you can see, subclasses would rely on the base class for a function that sets "my_float" but would be polymorphic with respect to another function.
So I wonder, this is a good practice. If you have an abstract base class, should you make it completely abstract, or is it ok to make such a hybrid approach?