官术网_书友最值得收藏!

Explaining Facade

Projects can sometimes turn out to be very complex and big, making them difficult to design and organize. To solve this, a great solution is to break a system into subsystems (divide and conquer) and make them less complex and better organized.

The Facade pattern creates a higher-level interface to hide a complexity of a set of interfaces in a subsystem. This pattern reduces the complexity and coupling, minimizing communication and dependencies between subsystems. In the following diagram, you can see the structure of Facade and how it is designed:

In the preceding diagram, we can see the Facade pattern encapsulating all of the calls to subsystems and hiding these calls from the client. The system has one interface, Facade, and the client calls this interface in order to call subsystems. Thus, clients does not call the subsystems directly. With this solution, the client doesn't need to know about the subsystem and its complexity.

This pattern is often used in projects and systems that have high complexity and need to be broken down into subsystems.

主站蜘蛛池模板: 厦门市| 海丰县| 博客| 方城县| 酉阳| 南宁市| 怀柔区| 双流县| 阿合奇县| 安塞县| 磐石市| 嘉定区| 阳泉市| 光山县| 甘洛县| 靖西县| 河间市| 巴林左旗| 临武县| 玉林市| 宜君县| 德安县| 阳城县| 南投市| 临桂县| 阜康市| 电白县| 建宁县| 嵊泗县| 浦县| 广灵县| 永德县| 翼城县| 蚌埠市| 射阳县| 台州市| 金川县| 依安县| 荔波县| 千阳县| 萝北县|