Design Pattern Explain 读书笔记2—— Facade 模式

Design Pattern Explain 读书笔记二—— Facade 模式

what?

Provide a unified interface to a set of interfaces in a sub- system.
Facade defines a higher-level interface that makes the subsystem
easier to use. ——GOF

给子系统中的一堆接口提供一个统一,标准的接口——更高层次的接口——这样使得子系统更易于使用。

Facade模式的特点:
Design Pattern Explain 读书笔记2—— Facade 模式
对应的译文:

意图:         希望简化原有系统的使用方式。需要定义自己的接口。
问题(应用场景):       只需要使用某个复杂系统的子集,或者,需要以一种特殊的
方式与系统交互。
解决方案:     Facade 为原有系统的客户提供了一个新的接口。
参与者与协作者:     为客户提供的一个简化接口,使系统更容易使用。
效果:         Facade 模式简化了对所需子系统的使用过程。但是,由于Facade 并不完整,因此客户可能无法使用某些功能。

实现: 定义一个(或多个)具备所需接口的新类。让新的类使用原有的系统。

Design Pattern Explain 读书笔记2—— Facade 模式

where?

待续

why?

待续

how?

待续

disadvantages?

待续

明晚待续………………

版权声明:本文为博主原创文章,未经博主允许不得转载。