Adapter SENG 609.04 Design Patterns Winter, 2003 Presented by Ming Zhou, Guy Davis 2. Adapter pattern works as a bridge between two incompatible interfaces. The Adapter pattern acts as an intermediary between two classes, converting the interface of one class so that it can be used with the other. Adapter pattern's motivation is that we can reuse existing software if we can modify the interface. In object-oriented programming, the decorator pattern is a design pattern that allows behavior to be added to an individual object, dynamically, without affecting the behavior of other objects from the same class. Each design pattern systematically names and evaluates an important and recurring design in object-oriented systems. The adapter pattern is adapting between classes and objects. The Adapter pattern implements an interface known to its clients and provides access to an instance of a class not known to its clients. In software engineering, a software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design.It is not a finished design that can be transformed directly into source or machine code.Rather, it is a description or template for how to solve a problem that can be used in many different situations. Two different systems have completely different interfaces to communicate with outside. Adapter design pattern falls under the category of the structural design pattern. Adapter (or Wrapper) lets classes work together that couldn't otherwise because of incompatible interfaces. Adapter SENG 609.04 Design Patterns Winter, 2003 Presented by Ming Zhou, Guy Davis 2. Problem Given: Suppose you want to create a class for which only a single instance (or object) should be created and that single object can be used by all other classes. Adapter design pattern is one of the structural design pattern and its used so that two unrelated interfaces can work together. The object that joins these unrelated interface is called an Adapter. The decorator pattern is often useful for adhering to the Single Responsibility Principle, as it allows functionality to be divided between classes with unique areas of concern. Adapter Pattern Motivation. Adapter pattern is placed under the category of structural design pattern. It is often used to make existing classes work with others without modifying their source code. Suppose we are building a cricket app that notifies viewers about the information such as current score, run rate etc. This type of design pattern comes under structural pattern as this pattern combines the capability of two independent interfaces. In software engineering, the adapter pattern is a software design pattern that allows the interface of an existing class to be used as another interface. The underlying classes or objects will not change but there is […] Our goal is to capture design experience in a form that people can use effectively.