# SOLID

### Liskov

```javascript
class Geometry {
  getArea() {
    throw new Error('Not implemented');
  }
}

class SquareGeometry extends Geometry {
  constructor() {
    this.size = 0;
  }

  getArea() {
    return this.size * this.size;
  }
}

class RectangleGeometry extends Geometry {
  constructor() {
    this.width = 0;
    this.height = 0;
  }

  getArea() {
    return this.width * this.height;
  }
}

class Square {
  constructor() {
    this.geometry = new SquareGeometry();
  }
}

class Rectangle {
  constructor() {
    this.geometry = new RectangleGeometry();
  }
}

let s1 = new Square();
s1.geometry.size = 10;
s1.geometry.getArea();

let s1 = new Rectangle();
s1.geometry.width = 10;
s1.geometry.heightp = 10;
s1.geometry.getArea();

```
