读书笔记-外观模式又叫门面模式
2017-05-05 17:59
246 查看
外观模式:
外观模式(Facade),为子系统中的一组接口提供一个一致的界面,此模式定义了一个高层接口,这个接口使得这一子系统更加容易使用。
四个子系统的类
class SubSystemOne{
public void MethodOne(){
System.err.println("子系统方法一");
}
}
class SubSystemTwo{
public void MethodTwo(){
System.err.println("子系统方法二");
}
}
class SubSystemThree{
public void MethodThree(){
System.err.println("子系统方法三");
}
}
class SubSystemFour{
public void MethodFour(){
System.err.println("子系统方法四");
}
}
外观类
class Facede
{
SubSystemOne one;
SubSystemTwo two;
SubSystemThree three;
SubSystemFour four;
public Facede(){
one = new SubSystemOne();
two = new SubSystemTwo();
three = new SubSystemThree();
four = new SubSystemFour();
}
...
}
外观模式(Facade),为子系统中的一组接口提供一个一致的界面,此模式定义了一个高层接口,这个接口使得这一子系统更加容易使用。
四个子系统的类
class SubSystemOne{
public void MethodOne(){
System.err.println("子系统方法一");
}
}
class SubSystemTwo{
public void MethodTwo(){
System.err.println("子系统方法二");
}
}
class SubSystemThree{
public void MethodThree(){
System.err.println("子系统方法三");
}
}
class SubSystemFour{
public void MethodFour(){
System.err.println("子系统方法四");
}
}
外观类
class Facede
{
SubSystemOne one;
SubSystemTwo two;
SubSystemThree three;
SubSystemFour four;
public Facede(){
one = new SubSystemOne();
two = new SubSystemTwo();
three = new SubSystemThree();
four = new SubSystemFour();
}
...
}
相关文章推荐
- 【读书笔记】将外观模式写好了与大家分享(C#,C++)
- 外观模式/门面模式
- 子系统类软件设计模式系列之三 门面模式(也叫外观模式,Facade) .
- 小猪学设计模式——门面模式(外观模式)
- 设计模式之 外观(门面)模式 Facade
- 11. Facade外观[门面模式](结构型模式)
- facade pattern--门面模式或外观模式
- 门面(外观)模式
- 外观/门面模式(Facade)
- 设计模式之门面(外观)模式(Facade)
- 模版方法、迪米特法则、外观模式(门面模式)
- 读书笔记10:外观模式
- 软件设计模式系列之四 门面模式(也叫外观模式,Facade) .
- 第十二章 牛市股票还会亏钱-外观模式(读书笔记)
- 门面模式(外观模式):Facade
- 读书笔记10:外观模式
- 外观模式/ 门面模式(Facade Pattern)
- 《Head First设计模式》 读书笔记08 适配器模式与外观模式 The Adapter and Façade Patterns
- 设计模式初探-外观模式(FACADE)也叫门面模式