Design patterns learning summary (f) - skin mode

definition

Facade pattern (Facade) hides the complexity of the system, only provides an interface can access the system to the client. This type of design patterns are structural mode. It provides a uniform access interface to a set of subsystem interface that makes the subsystem easier access or use.

In simple terms, the model is the appearance of a number of complex processes into a package supplying external user interfaces easier to use. This mode, designed to three characters.

  • Customer role: to complete the function to be achieved by calling the facade roles.
  • Facade roles: the appearance of the core model. It is called the client role, it is familiar with the subsystem functionality. According to the internal needs of customers booked the role of a combination of several functions.
  • Subsystem role: to achieve a functional subsystems. Customer role and the role of its facade is unknown. It can have another internal interactions within the system, the interface can also be called by the external supply.

The core purpose: to simplify subsystem to simplify customers, shielded multiple subsystems

Advantages and disadvantages

advantage:

  • Loosely coupled, decoupled user subsystem, subsystem shield; can improve the independence of the subsystem;
  • Users only with docking facade, a unified entrance; do not need to know all the subsystems and internal structure;

Disadvantages:

  • Non-standard way of programming
  • No abstract-oriented programming, but by increasing the interposer, conversion service interface service provider side;

Guess you like

Origin www.cnblogs.com/markLogZhu/p/11460434.html