Long-known Wraper or Decorator design pattern
Here is an example on java from wikipedia
abstract class WindowDecorator extend Window { protected Window windowToBeDecorated; // the Window being decorated public WindowDecorator (Window windowToBeDecorated) { this.windowToBeDecorated = windowToBeDecorated; } public void draw() { windowToBeDecorated.draw(); //Delegation } public String getDescription() { return windowToBeDecorated.getDescription(); //Delegation } } So, I don’t quite understand why to transfer a class object from which to inherit to a wrapper?
With inheritance, we already get all the same and can directly call ...