惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
W
WeLiveSecurity
O
OpenAI News
N
News and Events Feed by Topic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Webroot Blog
Webroot Blog
Google Online Security Blog
Google Online Security Blog
云风的 BLOG
云风的 BLOG
N
News | PayPal Newsroom
H
Hacker News: Front Page
博客园_首页
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Last Watchdog
The Last Watchdog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Heimdal Security Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Schneier on Security
宝玉的分享
宝玉的分享
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Y
Y Combinator Blog
Cyberwarzone
Cyberwarzone
Microsoft Security Blog
Microsoft Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
GbyAI
GbyAI
Cloudbric
Cloudbric
TaoSecurity Blog
TaoSecurity Blog
人人都是产品经理
人人都是产品经理
P
Palo Alto Networks Blog
M
MIT News - Artificial intelligence
G
GRAHAM CLULEY
C
Check Point Blog
Apple Machine Learning Research
Apple Machine Learning Research
Last Week in AI
Last Week in AI
T
Troy Hunt's Blog
L
Lohrmann on Cybersecurity
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Proofpoint News Feed
Blog — PlanetScale
Blog — PlanetScale
量子位
博客园 - 聂微东
S
Securelist
博客园 - 三生石上(FineUI控件)
F
Full Disclosure
G
Google Developers Blog
L
LINUX DO - 热门话题
P
Proofpoint News Feed
AI
AI
PCI Perspectives
PCI Perspectives

博客园 - 杞人

float、double为0判断 Excel操作知识(持续补充) 算法设计方案 C# 动态编译及反射执行 解决由于DTD规范引发Table设置高度无效 - 杞人 - 博客园 VS.NET 代码折叠Region C#访问FTP VS.NET 自动生成版本号问题 - 杞人 - 博客园 UDP通讯 DataSet中表的关系及约束 Web Services 获取当前路径! Windows Services .NET超时解决方案 Decorator 装饰模式(结构型模式) AJAX.NET请求时发生异常处理方案 setTimeout和setInterval的使用说明 write( ) 和 writeln( )使用说明 Composite 组合模式(结构型模式)
Facade 外观模式(结构型模式)
杞人 · 2007-07-08 · via 博客园 - 杞人

动机:
如何简化外部客户程序和系统间的交互接口?如何将外部客户程序的演化和内部子系统的变化之间的依赖相互解耦?

意图:
为子系统中的一组接口提供一个一致的界面,Facade模式定义了一个高层接口,这个接口使得这一子系统更加容易使用。

 Facade模式的几个要点
1、从客户程序的角度来看,Facade模式不仅简化了组件系统的接口,同时对于组件内部与外部客户程序来说,从某种程序上也达到了一种“解耦”的效果----内部子系统的任何变化不会影响到Facade接口的变化。
2、Facade设计模式更注重从架构的层次去看整个系统,而不是单个类的层次。Facade很多时候更是一种架构设计模式。
3、注意区分Facade模式、Adapter模式、Bridge模式与Decorator模式。Facade模式注重简化接口,Adapter模式注重转换接口,Bridge模式注重分离接口(抽象)与其实现,Decorator模式注重稳定接口的前提下为对象扩展功能。

 internal class Wheel
 {
  public void VAction1()
  {
  }
  public void WAction2()
  {
  }
 }
 internal class Engine
 {
  public void EAction1()
  {
  }
  public void EAction2()
  {
  }
 }
 internal class Bodywork
 {
  public void BAction1()
  {
  }
  public void BAction2()
  {
  }
 }
 internal class Controller
 {
  public void CAction1()
  {
  }
  public void CAction2()
  {
  }
 }

 public class TankFacade
 {
  Wheel[] wheels = new Wheel[4];//轮子
  Engine[] engines = new Engine[4];//引擎
  Bodywork bodywork = new Bodywork();//车体
  Controller controller = new Controller();//控制器

  public void start()
  {
   //wheels
   //engines
   //controller
  }
  public void Stop()
  {
   //wheels
   //engines
   //controller
  }
  public void Run()
  {
   //wheels
   //engines
   //bodywork
   //controller
  }
  public void Shot()
  {
  }
 }