博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
设计模式之 -- Facade pattern (外观模式)
阅读量:4137 次
发布时间:2019-05-25

本文共 1060 字,大约阅读时间需要 3 分钟。

The facade pattern is a commonly used with . (The name is by analogy to an .)

A facade is an object that provides a simplified interface to a larger body of code, such as a . A facade can:

  • make a easier to use and understand, since the facade has convenient methods for common tasks;
  • make code that uses the library more readable, for the same reason;
  • reduce dependencies of outside code on the inner workings of a library, since most code uses the facade, thus allowing more flexibility in developing the system;
  • wrap a poorly-designed collection of APIs with a single well-designed API (as per task needs).

An is used when the wrapper must respect a particular interface and must support a polymorphic behavior. On the other hand, a facade is used when one wants an easier or simpler interface to work with.

 

 

 

Facade
The facade class abstracts Packages 1, 2, and 3 from the rest of the application.
Clients
The objects using the Facade Pattern to access resources from the Packages.
Packages
Software library / API collection accessed through the Facade Class.

转载地址:http://ulmvi.baihongyu.com/

你可能感兴趣的文章
《融入动画技术的交互应用》主题博文推荐
查看>>
链睿和家乐福合作推出下一代零售业隐私保护技术
查看>>
Unifrax宣布新建SiFAB™生产线
查看>>
艾默生纪念谷轮™在空调和制冷领域的百年创新成就
查看>>
NEXO代币持有者获得20,428,359.89美元股息
查看>>
Piper Sandler为EverArc收购Perimeter Solutions提供咨询服务
查看>>
RMRK筹集600万美元,用于在Polkadot上建立先进的NFT系统标准
查看>>
JavaSE_day14 集合中的Map集合_键值映射关系
查看>>
异常 Java学习Day_15
查看>>
Mysql初始化的命令
查看>>
MySQL关键字的些许问题
查看>>
浅谈HTML
查看>>
css基础
查看>>
Servlet进阶和JSP基础
查看>>
servlet中的cookie和session
查看>>
过滤器及JSP九大隐式对象
查看>>
软件(项目)的分层
查看>>
菜单树
查看>>
Servlet的生命周期
查看>>
JAVA八大经典书籍,你看过几本?
查看>>