An adapter or adaptor is a device that converts attributes of one electrical device or system to those of an otherwise incompatible device or system. Some modify power or signal attributes, while others merely adapt the physical form of one electrical connector to another.
An electric power adapter may enable connection of a power plug, sometimes called «travel plug», used in one region to a AC power socket used in another, by offering connections for the disparate contact arrangements, while not changing the voltage. An AC adapter, also called a "recharger", is a small power supply that changes household electric current from distribution voltage (in the range 100 to 240 volts AC) to low voltage DC suitable for consumer electronics.
For computers and related items, one kind of serial port adapter enables connections between 25-contact and nine-contact connectors, but does not affect electrical power- and signalling-related attributes.
In software engineering, the adapter pattern is a software design pattern that allows the interface of an existing class to be used from another interface. It is often used to make existing classes work with others without modifying their source code.
An adapter helps two incompatible interfaces to work together. This is the real world definition for an adapter. Interfaces may be incompatible but the inner functionality should suit the need. The Adapter design pattern allows otherwise incompatible classes to work together by converting the interface of one class into an interface expected by the clients.
There are two types of adapter patterns:
In this type of adapter pattern, the adapter contains an instance of the class it wraps. In this situation, the adapter makes calls to the instance of the wrapped object.
This type of adapter uses multiple polymorphic interfaces implementing or inheriting both the interface that is expected and the interface that is pre-existing. It is typical for the expected interface to be created as a pure interface class, especially in languages such as Java (before jdk 1.8) that do not support multiple inheritance of classes.
In computing, adapter is a hardware device or software component that converts transmitted data from one presentation form to another. The data presentation can be, for example, a message sent between objects in an application or a packet sent through a network.
In modern personal computer, almost every peripheral device uses an adapter to communicate with system bus, for example:
A concept of adapter should not be confused with an expansion card. Although every expansion card typically implements some kind of adapter, many other adapters in a modern PC are built into the motherboard itself.
A software component adapter is a type of software that is logically located between two software components and reconciles the differences between them.