Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Source

https://refactoring.guru/design-patterns/adapter

Important:

  1. Adapter is a structural design pattern that allows objects with incompatible interfaces to collaborate.
  2. Match interfaces of different classes

Description

Structure

alt tag

How to use

  1. Use the Adapter class when you want to use some existing class, but its interface isn’t compatible with the rest of your code.
  2. Use the pattern when you want to reuse several existing subclasses that lack some common functionality that can’t be added to the superclass.

How to implement

https://refactoring.guru/design-patterns/adapter#checklist

Running

python main.py
python example.py