Definition: converts an interface of a class to another interface that the customer wants. The adapter mode allows classes that cannot work together due to interface incompatibility. Type: Structure Mode classification: Class adapter mode and Object Adapter mode: Class adapter mode matches the interface through multiple inheritance, while C #, VB.. NET, JAVA, and other languages do not support multiple inheritance. A class only allows one parent class. So we mainly introduce the Object Adapter mode. Class diagram: Code: [csharp] // Target class Target {public virtual void Request () {Console. WriteLine ("common Request! ") ;}} [Csharp] // Adaptee class Adaptee {public void SpecificRequest () {Console. WriteLine (" special request! ") ;}} [Csharp] // Adapter class Adapter: Target {private Adaptee adaptee = new Adaptee (); // create a private Adaptee object public override void Request () {adaptee. specificRequest () ;}} [csharp] // client code Target = new Adapter (); // instantiate the object target. request (); Console. read (); advantages and applicability: the two classes share the same or similar things and want to reuse these existing classes. However, different interfaces have different requirements from the Reuse Environment, when both parties are not easy to modify, you should consider using the adapter mode. The adapter mode allows the customer code to call the same interface in a unified manner, which is simpler, more direct, and more compact. Note: The adapter mode is used after software development or maintenance. 1. During the software design phase, different interfaces are prevented in advance so that no mismatch will occur. 2. If an interface inconsistency problem occurs, you should first consider rebuilding the unified interface in a timely manner; 3. Adaptation is considered only when the original design and Code cannot be changed.