I'm creating a vector editing program in C++, and I need a Shape interface which other concrete classes will implement. There is a requirement that no implementation inheritance is allowed. The design doc says that if you need polymorphism, use interfaces. If you need code reuse, use composition.The Shape interface is:class Shape{  public:   virtual void get_name()=0;   virtual void set_name()=0;   virtual void get_linewidth()=0;   virtual void set_linewidth()=0;   ...   ...about 20 other getters/setters   ...   virtual void draw()=0;   virtual int area()=0;   virtual void rotate(int angle)=0;}The Circle class:class Circle: public Shape{  string name;  int line_width;  int angle_of_rotation;  int radius;public:  string get_name(){ return name; }  string set_name(string name){ this->name=name; }  ...  ...about 20 other getters/setters  ...  int area()  {    return PI*pow(this->radius,2);  }}I have no problem with this, except common properties have to be repeated for each type of shape! This is solved using inheritance, but I am not allowed to use that.So, I create a ShapeProperties classclass ShapeProperties{  string name;  int line_width;  int angle_of_rotation;public:  string get_name(){ return name; }  string set_name(string name){ this->name=name; }  ...  ...about 20 other getters/setters  ...}and a properties() method for the interface:virtual ShapeProperties* properties()=0;A user would then do:Shape *shape = new Circle();shape->properties()->set_name(my shape);shape->properties()->set_line_width(4);int area = shape->area();My question: Is this good design? Is this bad design? Are there any obvious problems? How could it be made better?
Is this bad design for a Shape interface?
design;object oriented;code smell;interfaces;composition