当前位置:网站首页>【DesignMode】外观模式 (facade patterns)
【DesignMode】外观模式 (facade patterns)
2022-07-07 14:16:00 【weixin_43224306】
基本介绍
外观模式(Facade),也叫“过程模式:外观模式为子系统中的一组接口 提供一个一致的界面,此模式定义了一个高层接口,这个接口使得这一子系统更加容易使用
外观模式通过定义一个一致的接口,用 以屏蔽内部子系统的细节,使得 调用端只需跟这个接口发生调用,而无需关心这个子系统的内部细节
1. 影院管理项目
组建一个家庭影院:
DVD 播放器、投影仪、自动屏幕、环绕立体声、爆米花机,要求完成使用家庭影院的功能,其过程为:
直接用遥控器:统筹各设备开关
开爆米花机
放下屏幕
开投影仪
开音响
开 DVD,选 dvd
去拿爆米花
调暗灯光
播放
观影结束后,关闭各种设备
2. 传统方式解决影院管理
类图:
代码:
ClientTest{
public static
边栏推荐
猜你喜欢
MySQL数据库基本操作-DQL-基本查询
Strengthen real-time data management, and the British software helps the security construction of the medical insurance platform
Application example of infinite list [uigridview]
Tragedy caused by deleting the console statement
Xcode Revoke certificate
1亿单身男女“在线相亲”,撑起130亿IPO
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
Rongyun won the 2022 China Xinchuang digital office portal excellence product award!
AutoLISP series (1): function function 1
Power of leetcode-231-2
随机推荐
Mysql database basic operation DQL basic query
Power of leetcode-231-2
Laravel 中config的用法
Find tags in prefab in unity editing mode
Laravel constructor and middleware execution order
Particle effect for ugui
Eye of depth (VI) -- inverse of matrix (attachment: some ideas of logistic model)
Have fun | latest progress of "spacecraft program" activities
[flower carving experience] 15 try to build the Arduino development environment of beetle esp32 C3
Usage of config in laravel
Set the route and optimize the URL in thinkphp3.2.3
[excelexport], Excel to Lua, JSON, XML development tool
[hcsd celebrity live broadcast] teach the interview tips of big companies in person - brief notes
【Android -- 数据存储】使用 SQLite 存储数据
Statistical learning method -- perceptron
markdown公式编辑教程
js中复选框checkbox如何判定为被选中
Three. JS series (1): API structure diagram-1
Performance comparison of tidb for PostgreSQL and yugabytedb on sysbench
torch. Numel action