adapter design pattern
TRANSCRIPT
![Page 1: Adapter design pattern](https://reader036.vdocuments.us/reader036/viewer/2022071814/55a521dd1a28abbf348b47e1/html5/thumbnails/1.jpg)
A D A P T E R ( W R A P P E R )
D E S I G N PA T T E R N
G I T H U B . C O M / G R I T T | C O M P U T E R S C I E N C E - U F P E L
![Page 2: Adapter design pattern](https://reader036.vdocuments.us/reader036/viewer/2022071814/55a521dd1a28abbf348b47e1/html5/thumbnails/2.jpg)
S T R U C T U R A L PAT T E R N S
D E S I G N PAT T E R N S : E L E M E N T S O F R E U S A B L E O B J E C T- O R I E N T E D S O F T W A R E
“Structural patterns are concerned with how classes and objects are composed to form
larger structures."
”Structural class patterns use inheritance to compose interfaces or implementations.”
“…structural object patterns describe ways to compose objects to realize new functionality."
![Page 3: Adapter design pattern](https://reader036.vdocuments.us/reader036/viewer/2022071814/55a521dd1a28abbf348b47e1/html5/thumbnails/3.jpg)
A D A P T E R
D E S I G N PAT T E R N S : E L E M E N T S O F R E U S A B L E O B J E C T- O R I E N T E D S O F T W A R E
"Covert the interface of a class into another interface clients expect. Adapter lets classes work
together that couldn’t otherwise because of incompatible interface”.
![Page 4: Adapter design pattern](https://reader036.vdocuments.us/reader036/viewer/2022071814/55a521dd1a28abbf348b47e1/html5/thumbnails/4.jpg)
D R A W I N G E D I T O R A P PA D A P T E R E X A M P L E
![Page 5: Adapter design pattern](https://reader036.vdocuments.us/reader036/viewer/2022071814/55a521dd1a28abbf348b47e1/html5/thumbnails/5.jpg)
A P P L I C A B I L I T Y
• you want to use an existing class, and its interface does not match the one you need;
• you want to create a reusable class that cooperates with unrelated or unforeseen classes, that is, classes that don’t necessarily have compatible interfaces;
![Page 6: Adapter design pattern](https://reader036.vdocuments.us/reader036/viewer/2022071814/55a521dd1a28abbf348b47e1/html5/thumbnails/6.jpg)
I S S U E S T O C O N S I D E R
• How much adapting does Adapter do?
• How similar the target interface is to adaptee's
![Page 7: Adapter design pattern](https://reader036.vdocuments.us/reader036/viewer/2022071814/55a521dd1a28abbf348b47e1/html5/thumbnails/7.jpg)
R E F E R E N C E S
Book:
Slides available at:
slideshare.net/gilvanritter/design-patterns-adapter