banner

Adaptation Mode

- Feb 07, 2019-

In computer programming, an adapter pattern (sometimes called a wrapper style or wrapper) adapts the interface of a class to what the user expects. An adaptation allows classes that normally cannot work together because the interfaces are incompatible, by wrapping the class's own interface in an existing class.


The adapter mode is mainly used when the method defined in the interface cannot meet the customer's requirements, or the name of the method defined in the interface or the method interface conflicts with the customer's requirements.


Two types of modes: • Object Adapter Mode - In this adapter mode, the adapter holds an instance of the class it wraps around. In this case, the adapter calls the physical entity of the wrapped object. Class Adapter Mode - In this adapter mode, the adapter inherits from the implemented class (general multiple inheritance).


The adapter does not have data rate conversion.

In computer programming, adapters include: container adapters, iterator adapters, functional adapters, etc.

24

Previous: Adapter Use

Next: Adapter Category

Related Products