in structurethe adapter pattern is similar to simplified decorator pattern decorators typically provide the same interface that they replacewhereas adapters map between two different interfaces here it is in uml forminterface adapter +make_action(some,argumentsinterface +different_action(other,argumentshereinterface is expecting to call method called make_action(someargumentswe already have this perfect interface class that does everything we want (and to avoid duplicationwe don' want to rewrite it!)but it provides method called different_action(otherargumentsinstead the adapter class implements the make_action interface and maps the arguments to the existing interface the advantage here is that the code that maps from one interface to another is all in one place the alternative would be really uglywe' have to perform the translation in multiple places whenever we need to access this code for exampleimagine we have the following preexisting classwhich takes string date in the format "yyyy-mm-ddand calculates person' age on that dayclass agecalculatordef __init__(selfbirthday)self yearself monthself day int(xfor in birthday split('-')def calculate_age(selfdate)yearmonthday int(xfor in date split('-')age year self year if (month,day(self month,self day)age - return age