Created
August 3, 2020 10:00
-
-
Save yaakov123/efa021d2687e3e1cfb0e807ee3f8571a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Director { | |
constructor(builder) { | |
this.builder = builder; | |
} | |
constructFamilyHouse() { | |
return this.builder | |
.buildWalls(4) | |
.buildRoof('sloped') | |
.buildGarden(['trees', 'grass', 'peacocks']) | |
.getHouse(); | |
} | |
constructMansion() { | |
// Steps for building a mansion | |
} | |
} | |
const director = new Director(new HouseBuilder()); | |
const familyHouse = director.constructFamilyHouse(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment