当前位置:网站首页>【DesignMode】外观模式 (facade patterns)
【DesignMode】外观模式 (facade patterns)
2022-07-07 14:16:00 【weixin_43224306】
基本介绍
外观模式(Facade),也叫“过程模式:外观模式为子系统中的一组接口 提供一个一致的界面,此模式定义了一个高层接口,这个接口使得这一子系统更加容易使用
外观模式通过定义一个一致的接口,用 以屏蔽内部子系统的细节,使得 调用端只需跟这个接口发生调用,而无需关心这个子系统的内部细节
1. 影院管理项目
组建一个家庭影院:
DVD 播放器、投影仪、自动屏幕、环绕立体声、爆米花机,要求完成使用家庭影院的功能,其过程为:
直接用遥控器:统筹各设备开关
开爆米花机
放下屏幕
开投影仪
开音响
开 DVD,选 dvd
去拿爆米花
调暗灯光
播放
观影结束后,关闭各种设备
2. 传统方式解决影院管理
类图:

代码:
ClientTest{
public static 边栏推荐
- AutoLISP series (3): function function 3
- Xcode Revoke certificate
- 【C 语言】 题集 of Ⅹ
- IP地址和物理地址有什么区别
- 分步式監控平臺zabbix
- three. JS create cool snow effect
- Laravel post shows an exception when submitting data
- Geoserver2.18 series (5): connect to SQLSERVER database
- How to determine whether the checkbox in JS is selected
- 【HCSD大咖直播】亲授大厂面试秘诀-简要笔记
猜你喜欢

1亿单身男女“在线相亲”,撑起130亿IPO

"The" "PIP" "entry cannot be recognized as the name of a cmdlet, function, script file, or runnable program."

What are compiled languages and interpreted languages?

HAVE FUN | “飞船计划”活动最新进展

AutoLISP series (1): function function 1

华东师大团队提出,具有DNA调控电路的卷积神经网络的系统分子实现
![Application example of infinite list [uigridview]](/img/11/3be1c63680e6de8f068e79690ecf12.jpg)
Application example of infinite list [uigridview]

SysOM 案例解析:消失的内存都去哪了 !| 龙蜥技术

TiDB For PostgreSQL和YugabyteDB在Sysbench上的性能对比

删除 console 语句引发的惨案
随机推荐
Xcode Revoke certificate
[vulnhub range] thales:1
Balanced binary tree (AVL)
01tire+ chain forward star +dfs+ greedy exercise one
无法将“pip”项识别为 cmdlet、函数、脚本文件或可运行程序的名称
47_Opencv中的轮廓查找 cv::findContours()
记录Servlet学习时的一次乱码
laravel 是怎么做到运行 composer dump-autoload 不清空 classmap 映射关系的呢?
What else can an ordinary person do besides working in a factory to make money?
PHP realizes wechat applet face recognition and face brushing login function
TiDB For PostgreSQL和YugabyteDB在Sysbench上的性能对比
Performance comparison of tidb for PostgreSQL and yugabytedb on sysbench
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
47_ Contour lookup in opencv cv:: findcontours()
Opportunity interview experience summary
Record the migration process of a project
Laravel5.1 Routing - routing packets
121. The best time to buy and sell stocks
[flower carving experience] 15 try to build the Arduino development environment of beetle esp32 C3
Cesium(3):ThirdParty/zip. js