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

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.

主站蜘蛛池模板: 余干县| 信丰县| 九寨沟县| 河北省| 吉木乃县| 绥阳县| 石首市| 神池县| 寿宁县| 丰宁| 雅安市| 微山县| 塘沽区| 广安市| 文安县| 西昌市| 万全县| 湖州市| 长葛市| 蓝田县| 安达市| 岑溪市| 哈密市| 林周县| 卓资县| 济宁市| 望谟县| 吴堡县| 商洛市| 那曲县| 建始县| 泌阳县| 恩施市| 湖州市| 伊宁县| 永平县| 定西市| 澜沧| 信阳市| 滦南县| 榆中县|