Nahradí viacnásobné dedenie párom objektov, ktoré sa navzájom držia.
class Body { move(dx, dy) { throw new Error('abstraktná metóda'); }} class Widget { redraw() { throw new Error('abstraktná metóda'); }} // First half: belongs to the world of physics.class BallBody extends Body { constructor() { super(); this.twin = null; } move(dx, dy) { this.x += dx; this.y += dy; this.twin.redraw(); }} // Second half: belongs to the world of drawing.class BallWidget extends Widget { constructor() { super(); this.twin = null; } redraw() { drawCircle(this.twin.x, this.twin.y); }} const body = new BallBody();const widget = new BallWidget(); body.twin = widget;widget.twin = body;