※ design patterns ※ → ☆ ☆ ============ Facade structural model mode (XII)

Overview mode

Facade pattern mode, also known as facade or appearance mode. Groups is a group having a similar function, such as libraries, subsystem, etc., provide a simple interface consistent. This simple interface consistent referred facade. Facade its internal communication with the external model requires a subsystem must be unified through a Facade object. Facade pattern provides a high-level interface, such that the subsystem easier to use.

Mode structure

Mode discussion

Facade pattern provides a simple interface to a complex subsystem, subsystem improve the independence, the hierarchical structure may be defined using the entry system Facade pattern each layer. Simplify the interaction interface between the client and external systems. The dependence between the change in the evolution of the external client and the internal subsystem decoupled from each other.

Facade Summary points:  (limiting the variation range in a subsystem)

  • 1. From the client's point of view, Façade pattern simplifies the entire assembly interface system. For internal and external clients who, Façade pattern to achieve a decoupling effect - that is, any changes will not affect the internal subsystems to change Façade interface.
  • 2.Façade pay more attention to design patterns from an architectural level to look at the entire system, rather than the level of a single class. Façade Many times it is an architectural design pattern.
  • 3.Façade design pattern is not a container can be placed in any arbitrary multiple objects. Facade internal mode component should be " coupled relationship relatively large number of components " rather than a simple set of functions, so as to enable loose coupling, high cohesion characteristics.

Related patterns to distinguish between:

  • Faade model focuses on simplified interface.
  • Adapter model focuses on conversion interface.
  • Bridge mode focus separation interface (abstract) from its implementation
  • Decorator model focuses on a stable interface objects premise extensions.

 

Pattern implementation
 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
after Xiao Ting notes will be as detailed as possible explain some knowledge, I hope you continue to focus on my blog.
This section notes to the end here.

Xiao Ting will have time to put their learning experience, feel better knowledge to write and share with everyone.
Programming development of the road is very long, very much like to be able to share together, learn together, and common progress.
If you have any articles oversight place, please correct me. I hope you and I can be more comments to discuss issues related to programming.
Finally, thank you for your support ~~~ been

       Complete C ++ code example (the code under test can be run in VS2017)
codes and related information Download:
              https://gitee.com/arvinxt/DesignPattern

 

 

Published 170 original articles · won praise 207 · Views 4.59 million +

Guess you like

Origin blog.csdn.net/xiaoting451292510/article/details/103859502