@@ -133,34 +133,34 @@ export default RequestPattern;`
133
133
{
134
134
name : 'Factory' ,
135
135
type : 'creational' ,
136
- codeES5 : `function bmwPattern (type) {
137
- if (type === 'X5 ') return new Bmw (type, 108000, 300);
138
- if (type === 'X6 ') return new Bmw (type, 111000, 320);
136
+ codeES5 : `function teslaPattern (type) {
137
+ if (type === 'ModelX ') return new Tesla (type, 108000, 300);
138
+ if (type === 'ModelS ') return new Tesla (type, 111000, 320);
139
139
}
140
140
141
- function Bmw (model, price, maxSpeed) {
141
+ function Tesla (model, price, maxSpeed) {
142
142
this.model = model;
143
143
this.price = price;
144
144
this.maxSpeed = maxSpeed;
145
145
}
146
146
147
- module.exports = bmwPattern ;` ,
148
- codeES6 : `class BmwPattern {
147
+ module.exports = teslaPattern ;` ,
148
+ codeES6 : `class TeslaPattern {
149
149
create(type) {
150
- if (type === 'X5 ') return new Bmw (type, 108000, 300);
151
- if (type === 'X6 ') return new Bmw (type, 111000, 320);
150
+ if (type === 'ModelX ') return new Tesla (type, 108000, 300);
151
+ if (type === 'ModelS ') return new Tesla (type, 111000, 320);
152
152
}
153
153
}
154
154
155
- class Bmw {
155
+ class Tesla {
156
156
constructor(model, price, maxSpeed) {
157
157
this.model = model;
158
158
this.price = price;
159
159
this.maxSpeed = maxSpeed;
160
160
}
161
161
}
162
162
163
- export default BmwPattern ;`
163
+ export default TeslaPattern ;`
164
164
} ,
165
165
/*
166
166
* Prototype
@@ -1273,7 +1273,7 @@ export { Product, fees, proft };`
1273
1273
* State
1274
1274
*/
1275
1275
{
1276
- name : 'Pattern ' ,
1276
+ name : 'State ' ,
1277
1277
type : 'behavioral' ,
1278
1278
codeES5 : `function Order() {
1279
1279
this.pattern = new WaitingForPayment();
0 commit comments