There is an educational task:
Define class specifications for representing graphic manipulators of geometric properties (position, size) in the vector graphics editor.
And there are three patterns: composite, decorator, and proxy. It seems to me that here is the decorator.
It is necessary to implement it with "stubs", i.e. not graphically.
And I ran into the problem that I cannot implement it as a pure decorator, since the functions for changing the size and position require transmitted values.
public interface Shape { public void draw(); public void setX(int x); public void setY(int y); public void setLength(int length); public void setHeight(int height); public void changePosition(int x, int y); public void changeSize(int length, int height); } The descendants that inherit the Shape also have the functions changePosition(int x, int y) and changeSize(int length, int height) , and it seems to me that this is not entirely correct. Maybe I chose the wrong pattern?