Created
August 2, 2020 18:20
-
-
Save yaakov123/890077bcccab317ae956d40ec3e35f34 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 DressClothesFactory { | |
constructor() { | |
} | |
getShoes() { | |
return new DressShoes(); | |
} | |
getShirt() { | |
return new DressShirt(); | |
} | |
} | |
class CasualClothesFactory { | |
constructor() { | |
} | |
getShoes() { | |
return new CasualShoes(); | |
} | |
getShirt() { | |
return new CasualShirt(); | |
} | |
} | |
class DressShoes { | |
constructor() { | |
} | |
// ...Shoe stuff here | |
} | |
class CasualShoes { | |
constructor() { | |
} | |
// ...Shoe stuff here | |
} | |
class DressShirt { | |
constructor() { | |
} | |
// ...Shirt stuff here | |
} | |
class CasualShirt { | |
constructor() { | |
} | |
// ...Shirt stuff here | |
} | |
const dressClothesFactory = new DressClothesFactory(); | |
const dressShoes = dressClothesFactory.getShoes(); | |
const casualClothesFactory = new CasualClothesFactory(); | |
const casualShirt = casualClothesFactory.getShirt(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment