返回目录

门面模式(Facade)属于结构型模式的一种,它符合面向对象的封装原则,但又不符合开闭原则,呵呵,今天我们主要说它的优点,不谈缺点.

定义

门面模式,是指提供一个统一的接口去访问多个子系统的多个不同的接口,它为子系统中的一组接口提供一个统一的高层接口。使用子系统更容易使用。

技巧

我们在设计子类时,由于外部通过门面去访问它的功能,所以一般子类都会被声明为internal.

何时能用到它?

1、客户只需要使用某个复杂系统的子集,或者需要以一种特殊的方式与系统交互时,使用门面模式。
2、当需要跟踪原系统的使用情况时 ,使用门面模面模式。因为所有对系统的访问都经过FACADE,所以可以很容易地监视系统的使用 。
3、希望封装和隐藏原系统时。
4、编写新类的成本小于所有人使用和维护原系统使用所需的成本时

观察者模式的结构图

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaYAAAEmCAIAAACmo6OMAAAgAElEQVR4nO2deXwTdf7/o7vrvYDngiKHfhUPPNZjEV0Q/OHqruJ6IBQQBQUrKtfaAkJFy1Guri1yiMglhxwuAstR2AJF5WgBAYG26ZkeaZv0SHPO5JrX/P6YNqRp2qZtMkfyfj7ej3nUNGTe9v3JM++Z+cwnKp4gCCJiUEmdAEEQhHiQ8giCiCBIeQRBRBCkPIIgIghSHkEQEQQpjyCICIKURxBEBEHKIwgigiDlEQQRQZDyCIKIIEh5BEFEEKQ8giAiCFIeQRARBCmPIIgIgpRHEEQEQcojCCKCIOURBBFBkPIIgoggSHkEQUQQpDyCICIIUh5BEBEEKY8giAiClEcQRARBylM2el3F0aOpy5cuXr50cWzM+CmTxlKIHMIff++eHVptidTDgWgZUp6COZS6P3FR/K4ft+blqXPzC/XVtkoDW2Vgq2qFsAtR7Qljg6gx2mtMvmEwOQwmh8FcF7WNwmjxDZPFWRfWy2H2DtvlsHiCcQlh9Q7WZWVdtkbBsC7GLoRbCNYTjgZh9w5nXTicnE84XQ3C5Ql3XbjdqAvucnDegbooLS0pKMgVarFl8zqGsUk9LojmIOUpEr2uIjkpYe+eHfpqW4HWkllozKqP7EJjtsaY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Ol5+Gc8/j/790acPHn0UDzyAu+9G16649VZ06MDdcgs6dcI996BvX7zyCt57D9OmITER332Hfftw6hQ0GpHXoybCD1Ie0QJwu2EwQKdDcTFyc3HxIn79FSdOIC0NBw5g92788AM2bcKaNVixAklJWLgQs2dj9mwsXIikJKxYgTVrsGkTfvgBu3fjwAGkpeHECfz6Ky5eRG4uiouh06G2lua+ESJAyiMIIoIg5REEEUGQ8giCiCBIeQRBRBCkPIIgIghSHkEQEQQpjyCICIKURxBEBEHKIwgigiDlEQQRQZDyCIKIIEh5BEFEEP8fj96WK/o2Xg4AAAAASUVORK5CYII=" alt="" />

观察者模式实现说明

FacadeFactory:门面对象,对外公开,将子系统进行组合,或者将子系统进行条件的筛选等等

Sub1:子系统1,它实现了IFacade接口

Sub2:子类型2,它实现了IFacade接口

IFacade:统一接口,可有可无,子类型去实现它,有时在门面类里需要通过接口来访问子系统时,需要这个接口

观察者模式的C#实现

#region 门面
public interface IFacade
{
void Implement();
}
public class FacadeFactory
{
int _subtype;
public FacadeFactory()
            : this(1)
        {         }
public FacadeFactory(int subType)
{
_subtype = subType;
}
public void Action()
{
//情况1,子类型的组合
new Sub1().Implement();
new Sub2().Implement(); //情况2,子类型的选择
switch (_subtype)
{
case :
new Sub1().Implement();
break;
case :
new Sub2().Implement();
break;
default:
throw new ArgumentException("子系统参数有误");
}
}
}
internal class Sub1 : IFacade
{ public void Implement()
{
Console.WriteLine("这是子系统1");
}
}
internal class Sub2 : IFacade
{ public void Implement()
{
Console.WriteLine("这是子系统2");
}
}
#endregion

调用代码

  new FacadeFactory().Action();

结果截图

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOEAAABgCAIAAABkPYJQAAAI1UlEQVR4nO2cWXMVRRTH8ywBWQKyKCQsIRDIvYEsQEgCCi4QFllUiLxbbAGCLEJIkEUg7LJ9nDxallZZpS+WVollgcKDhZ+gfTg3nU7P9Okz985lOsn/X6du9T1zprsn85szPXNPpeKXn76DwUK2CgVBYatCKZ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UEZSDUj0KhC/WjUOhC/SgUuuSMyrOdJN4VIKGquJ75TUknU/TkocTi7/WmkjKadBcm4zK52RWfaJ6mf8i9bPD2A0bLIr7GuUQsJIwyfXp7Y4DTHVqN2LFcXHqBtoaTHwuUQKnX4QuxlgPnimHivQjyAeax8B16DwpKQZLaPIa2qF+ee/gAZnT+GojtWRJvzj/6GTtP70FBKSjdZybX+YueSyGjRYi/Ziwnj7gX96gn2iFUqlz1o7SVOQHeFMKcpCIYTTSNWM54gLyHnGi2kgBIKvl6lJc+kV6YvGEMfLHjMs5oV3w80+YHjR5d7I5QMfIyKkwqDFKxbeY0x0qOcnTTUNxV4RqX4ZufJ+gslySMWrtECY6G8T14u5XESzqPzs3LtOszNt7bP5SCUsmj0V1cmxinl1GXmM41Q8yO0dlGN3kpdPUGpaAS86jLGZtj+E6EZ1cSlvSCEe7rivdePMzlxPdZpvgxJm9tHv/X15I7XZt4mhNdNtb8haNIBrLimXG9wYzA6Ci5GNUHLITJFcaT5+02tp/YtuVkMLU6t86u92KQXKXjFpdMlOhez2QmJl0xZ3TILWtfL+v8PCVDMJFMvMsJTFNTKv+nJEoD34mrH148OlnJNYfMJzZ+VGKNMwSVXWAUCl1gFApdYBQKXWAUCl1gFApdYBQKXP8DD1SV+Bcka14AAAAASUVORK5CYII=" alt="" />

返回目录

说说设计模式~门面模式(Facade)的更多相关文章

  1. 外观模式 门面模式 Facade 结构型 设计模式(十三)

    外观模式(FACADE) 又称为门面模式   意图 为子系统中的一组接口提供一个一致的界面 Facade模式定义了一个高层接口,这一接口使得这一子系统更加易于使用. 意图解析 随着项目的持续发展,系统 ...

  2. linkin大话设计模式--门面模式

    linkin大话设计模式--门面模式 随着系统的不断改进和开发,他们会变得越来越复杂,系统会生成大量的类,这使得程序的流程更加难以理解.门面模式可以为这些类提供一个简易的接口,从而简化访问这些类的复杂 ...

  3. 大熊君说说JS与设计模式之(门面模式Facade)迪米特法则的救赎篇------(监狱的故事)

    一,总体概要 1,笔者浅谈 说起“门面”这个设计模式其实不论新老程序猿都是在无意中就已经运用到此模式了,就像我们美丽的JS程序员一样不经意就使用了闭包处理问题, function Employee(n ...

  4. 设计模式——门面模式(Facade)

    要想正确理解设计模式,首先必须明白它是为了解决什么问题而提出来的. 设计模式学习笔记 --Shulin 转载请注明出处:http://blog.csdn.net/zhshulin 1.概念 门面模式是 ...

  5. 24种设计模式--门面模式【Facade Pattern】

    大家都写过纸质的信件吧,比如给女朋友写情书什么的,写信的过程大家都还记得吧,先写信的内容,然后写信封,把信放到信封中,封好,投递到信箱中进行邮递,这个过程还是比较简单的,虽然简单,这四个步骤都是要跑的 ...

  6. 设计模式 - 门面模式(Facade Pattern,也叫外观模式)

    简介 场景 将系统划分为若干个子系统有利于降低系统的复杂性,但是这会增加调用者的复杂性.通过引入 Facade 可以对调用者屏蔽系统内部子系统的细节. Java 中有多个日志库,例如 log4j.lo ...

  7. 设计模式在实际业务应用中的介绍之3——外观或门面模式Facade对AOP装配业务工厂的应用

    在C#中实现的基于外观或门面模式打造的业务应用案例 以前一直没有想过写一些东西来把项目中用到的知识点及技术实现做一个归纳整理并分享出来.现在打算逐渐的把项目中的一些东西整理并分享出来,与大家共勉! 外 ...

  8. Tomcat源代码-门面模式(Facade)

    从Tomcat源码提炼出设计模式-门面设计模式: 概念 外部访问内部,耦合度增加,不利于扩展.而门面模式在内部基础上进行再度封装,只提供外部想要的方法.这时访问方式由“外部---内部”变为了“外部-- ...

  9. c++ 门面模式(Facade)

    门面模式是比较常用的一种设计模式,我们可能在无意中就会使用,门面模式就是用一个门面类来处理子系统的复杂关系,门面类简单的Api接口供客户端调用.用一个简单的演播室来表示. #include <i ...

随机推荐

  1. java 读取文件内容 三种形式及效率对比

    IOUtils.getStringFromReader() 读取方式为最快的 InputStream in = null; String line = ""; long start ...

  2. UI基础

    知识点一:OC不允许直接修改对象的结构体属性的成员,允许直接修改对象的结构体属性 示例代码: CGRect tempFrame = self.frame; tempFrame.origin.x += ...

  3. php图片合成

    <?php//===================== 新建一个新的 GD 图像流并输出图像========================//header("Content-typ ...

  4. iOS和Android测试区别

    1.      Android长按home键呼出应用列表和切换应用,然后右滑则终止应用: 2.      多分辨率测试,Android端20多种,ios较少: 3.      手机操作系统,Andro ...

  5. iOS 的文字滚动条效果的实现

    UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(50, 100, 300, 50)]; label.text  = @"欢 ...

  6. access查询优化

    一个zirancun 14万数据量,一个 zirancuntd 19万数据,这两个  zirancuntd.distid 与zirancun.id进行关联,查询 zirancuntd.distid不存 ...

  7. AsyncOperation变成同步的代码

    template <typename TResult> TResult PerformSynchronously(Windows::Foundation::IAsyncOperation& ...

  8. Form表单提交数据的几种方式

    一.submit提交 在form标签中添加Action(提交的地址)和method(post),且有一个submit按钮(<input type='submit'>)就可以进行数据的提交, ...

  9. IIS部署ASP.NET常见错误

    今天本地 IIS部署一个.NET Framework 3.5 项目,首先出现一个错误: 静态机制没有办法处理脚本 检查MIME没有问题,检查应用程序池版本,2.0, 果断改成 4.0. 运行之后新错误 ...

  10. [转]C语言指针学习经验总结浅谈

    指针是C语言的难点和重点,但指针也是C语言的灵魂 . 这篇C语言指针学习经验总结主要是我入职以来学习C指针过程中的点滴记录.文档里面就不重复书上说得很清楚的概念性东西,只把一些说得不清楚或理解起来比较 ...