Object Oriented Software Engineering   View all facts   Glossary   Help
subject > pattern > design pattern > adapter
Next design patternantipattern    Updesign pattern    Previous design patternabstraction-occurrence   

adapter comparison table
Subject have solution have related patterns have references have context have forces have problem has definition is a subtopic of is a kind of is an instance of
design pattern zero or more related design patternsone or more references which indicate who developed or inspired a patterna contextone or more forcesa sentence or two explaining the main difficulty being tackledA pattern useful for the design of software6.1 - Introduction to Patternspattern 
adapter
  1. Rather than directly incorporating the reused class into your inheritance hierarchy, instead incorporate an «Adapter» class.
  2. The «Adapter»is connected by an association to the reused class, which we will call the «Adaptee».
  3. The polymorphic methods of the «Adapter» delegate to methods of the «Adaptee».
  4. The delegate method in the «Adaptee» may or may not have the same name as the delegating polymorphic method.
facade, read-only interface, proxyone 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 adaptee6.8 - The Adapter Pattern design pattern

Next design patternantipattern    Updesign pattern    Previous design patternabstraction-occurrence