-
Notifications
You must be signed in to change notification settings - Fork 33
/
facade.ats
47 lines (42 loc) · 1.09 KB
/
facade.ats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { Logger } from '../logger';
export class AbstractFacade {
constructor() {
this.logger = new Logger();
}
}
export class MonitorFacade extends AbstractFacade{
setMonitor() {
this.logger.log("You have Monitor.");
}
}
export class KeyboardFacade extends AbstractFacade{
setKeyboard() {
this.logger.log("You have keyboard.");
}
}
export class MouseFacade extends AbstractFacade{
setMouse() {
this.logger.log("You have mouse.");
}
}
export class LaptopFacade extends AbstractFacade{
setLaptop() {
this.logger.log("You have laptop.");
}
}
export class ComputerFacade extends AbstractFacade{
constructor() {
super();
this.monitor = new MonitorFacade();
this.keyboard = new KeyboardFacade();
this.mouse = new MouseFacade();
this.laptop = new LaptopFacade();
}
buildComputer() {
this.monitor.setMonitor();
this.keyboard.setKeyboard();
this.mouse.setMouse();
this.laptop.setLaptop();
this.logger.log("You have built a computer.");
}
}