Last active
April 21, 2022 07:32
-
-
Save htdangkhoa/e1c6a9d054892807751779831481bb39 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { AbstractFactory } from 'AbstractFactory'; | |
import { ConcreteProductA1, ConcreteProductA2 } from 'ProductA'; | |
import { ConcreteProductB1, ConcreteProductB2 } from 'ProductB'; | |
export class ConcreteFactory1 implements AbstractFactory { | |
public createProductA(): AbstractProductA { | |
return new ConcreteProductA1(); | |
} | |
public createProductB(): AbstractProductB { | |
return new ConcreteProductB1(); | |
} | |
} | |
export class ConcreteFactory2 implements AbstractFactory { | |
public createProductA(): AbstractProductA { | |
return new ConcreteProductA2(); | |
} | |
public createProductB(): AbstractProductB { | |
return new ConcreteProductB2(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment