State mode, which, when an object's internal state changes, allows it to change its behavior, and the object looks like it has changed its class.
State mode mainly solves the situation when the conditional expression of an object state transition is too complex. It is possible to simplify the complex judgment logic by transferring the judgment logic of the state to a series of classes representing different states.
To tell the truth, this pattern is very laborious to use, and it is not very important.
Adapter (Adapter), which transforms the interface of one class into another interface that the customer wants, the Adapter mode makes it possible to work together which classes that are inherently incompatible with the interface and cannot work together.
If you can first prevent the interface of different problems, the mismatch problem will not occur;
When the small interface does not unify the problem occurs, the time reconstructs, the problem does not enlarge;
The adaptation is only considered when it is impossible to change the original design and code.
DataAdapter is used as an adapter between a dataset and a data source to retrieve and save data. DataAdapter provides this adapter by mapping fill, which changes the data in the dataset to make it easier for data in the data source to match, and update, which changes the data in the data source to match the data in the dataset.
Big talk design mode note State mode (not recommended) adapter mode