adapter | - Rather than directly incorporating the reused class into your inheritance hierarchy, instead incorporate an «Adapter» class.
- The «Adapter»is connected by an association to the reused class, which we will call the «Adaptee».
- The polymorphic methods of the «Adapter» delegate to methods of the «Adaptee».
- The delegate method in the «Adaptee» may or may not have the same name as the delegating polymorphic method.
| facade, read-only interface, proxy | one of the Gang of Four patterns. | | You do not have access to multiple inheritance or you do not want to use it. | How do you obtain the power of polymorphism when reusing a class whose methods have the same function but do not have the same signature as the other methods in the hierarchy? | A pattern found in class diagrams in which you are able to reuse an 'adaptee' class by providing a class, (the adapter) that delegates to the adaptee | 6.8 - The Adapter Pattern | | design pattern |