Not for experts, but for people who are easy to forget. :) Haha ~
Factory and factory methods:
Generally, the factory refers to the factory class or the factory object, and the factory method is a method, that is, a part of the class. The keyword here is "method". classes with factory methods are not necessarily factory classes. In many book examples, factory methods are in the factory class. Yes, but it masks the key to the factory method.
An example of a very typical factory method is the enumeration of a set. The set itself is not a factory class, but the factory method is used to obtain an enumerative number that facilitates itself.
Generator and generator mode:
In the builder mode, the builder is only part of the mode. Another key part of this mode is the navigator. The mode is not complete when you leave the navigator. It should be noted that many of the scenarios where the generator is used do not adopt the generator mode. The absence of a navigator indicates that the construction process is not reused. In this case, the key to the generator mode is.
Note that many classes use generators for naming, but note that this is not necessarily the generator mode.
Bridging and bridging modes:
The purpose of the bridge mode is to separate the logic from the specific implementation. Here the bridge is a combination of logic and implementation abstraction. There are many other types of bridges. For example, dataadapter is an important component of ADO. net. It acts as a bridge between a specific database (such as sqlserver, Oracle) and dataset, but the bridge mode is not used in this structure.
Status and status mode:
State refers to the form of a thing. For example, a person has a fever and his or her temperature is above 37 degrees Celsius. However, state mode encapsulates different behaviors in different States. In other words, we can use a class with temperature to describe whether a person has a fever, but this does not adopt the state mode.
The State mode encapsulates the meanings of different actions of the same interface in different States. For example, the mouse drag action is used to select elements when editing the state; in the creation state, the position and size of the elements to be created are defined.
Adapter and adapter mode:
The adapter mode solves the inconsistency between two class interfaces, and the meaning of the adapter is much wider, which can solve various forms of incompatibility problems. For example, we can compile a data adapter to solve the inconsistency between the old and new databases. You can also create a communication adapter to solve communication protocol inconsistencies. However, these adapters do not usually use the adapter mode.
Decorator and decorator mode:
The key to the decorator mode is that the objects after being decorated have the same interface as the objects before completion. The expanded interface is the responsibility, but it has not changed. In other words, if the introduction of the decorator changes the interface, it is no longer the decorator mode.
Proxy and proxy modes:
The same as the decorator mode, the key of the proxy mode is that the interface must be the same. In the proxy mode, the client program does not need to know the existence of the agent or change the interface.
Generally, the proxy mode is different from the proxy mode. For example, if a LAN is installed with a proxy server, you must set the IP address and port of the proxy server in the browser, the user must know the existence of the agent, which is inconvenient to use. In particular, the temporary user who uses the laptop needs to change the agent everywhere.