-
Notifications
You must be signed in to change notification settings - Fork 75
/
Facade.js
108 lines (105 loc) · 3.32 KB
/
Facade.js
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
'use strict';
class Facade {
constructor() {
console.log("Facade class created");
}
gotoPage(dp) {
switch (dp) {
case "Facade":
console.log("This is the Facade");
break;
case "AbstractFactory":
console.log("This is the AbstractFactory");
break;
case "Builder":
console.log("This is the Builder");
break;
case "Factory":
console.log("This is the Factory");
break;
case "Prototype":
console.log("This is the Prototype");
break;
case "Singleton":
console.log("This is the Singleton");
break;
case "Adapter":
console.log("This is the Adapter");
break;
case "Bridge":
console.log("This is the Bridge");
break;
case "Composite":
console.log("This is the Composite");
break;
case "Decorator":
console.log("This is the Decorator");
break;
case "Flyweight":
console.log("This is the Flyweight");
break;
case "Proxy":
console.log("This is the Proxy");
break;
case "ChainofResponsibility":
console.log("This is the ChainofResponsibility");
break;
case "Command":
console.log("This is the Command");
break;
case "Interpreter":
console.log("This is the Interpreter");
break;
case "Iterator":
console.log("This is the Iterator");
break;
case "Mediator":
console.log("This is the Mediator");
break;
case "Memento":
console.log("This is the Memento");
break;
case "Observer":
console.log("This is the Observer");
break;
case "State":
console.log("This is the State");
break;
case "Strategy":
console.log("This is the Strategy");
break;
case "TemplateMethod":
console.log("This is the TemplateMethod");
break;
case "Visitor":
console.log("This is the Visitor");
break;
default:
console.log("nothing to be matched");
}
}
}
let facade = new Facade();
facade.gotoPage('Facade');
facade.gotoPage('AbstractFactory');
facade.gotoPage('Builder');
facade.gotoPage('Factory');
facade.gotoPage('Prototype');
facade.gotoPage('Singleton');
facade.gotoPage('Adapter');
facade.gotoPage('Bridge');
facade.gotoPage('Composite');
facade.gotoPage('Decorator');
facade.gotoPage('Flyweight');
facade.gotoPage('Proxy');
facade.gotoPage('ChainofResponsibility');
facade.gotoPage('Command');
facade.gotoPage('Interpreter');
facade.gotoPage('Iterator');
facade.gotoPage('Mediator');
facade.gotoPage('Memento');
facade.gotoPage('Observer');
facade.gotoPage('State');
facade.gotoPage('Strategy');
facade.gotoPage('TemplateMethod');
facade.gotoPage('Visitor');