Фасад (шаблон проектирования): различия между версиями
[непроверенная версия] | [непроверенная версия] |
Содержимое удалено Содержимое добавлено
Higimo (обсуждение | вклад) м оформление |
|||
Строка 37:
function SubSystem1() {
this.method1 = function() {
};
return this;
}
function SubSystem2() {
this.method2 = function() {
};
this.methodB = function() {
};
return this;
}
/* Facade */
function Facade() {
var s1 = new SubSystem1()
this.m1 = function() {
s1.method1();
s2.method2();
Строка 61 ⟶ 63 :
this.m2 = function() {
s2.methodB();
};
return this;
}
/* Client */
function
var facade = new Facade();
facade.m1();
facade.m2();
}
test();
/*
Выведет:
|