designed base class and derived class