The commonality in what you described is that the user will select a shape. A circle is a shape. A rectangle is a shape. One can enlarge a circle. One can move a circle. One can enlarge a rectangle. One can move a rectangle.For Example,in Micrsoft Paint brush user will select the circle object and draw it means he can use any object at any time .
There is something in common there, and we can say that one can move a shape, and one can enlarge a shape. So with a shape base class, the choice of functions is limited to those public member functions specified in shape, even though there may be many more derived class member functions that override these few shape virtual member functions.
It will not. You do not understand: according to your code, a Generic is a store, a Generic is a purc, and a Generic is a manu. Typecasting is useless.If I code like this then no need to write switch case. The ((Generic*)obj_ptr[class_id]->*pt[class_id][Fn_id])(); line will do all things for me ! right
You could do the opposite: create a Generic base class (similiar to the Object class in Java and many other OO languages). But then you still have to use a switch of some sort to typecast.
In other words, if there is no commonality, then you have no choice but to use a massive switch. If there is commonality, you can factor it out into a class hierarchy and use polymorphism.