O'Reilly logo
  • Ervin Varga thinks this is interesting:

Unify Interfaces with Adapter


Cover of Refactoring to Patterns


I think, this refactoring would be better named as 'Unify Interfaces with Bridge'. The Bridge pattern is actually more fit for the purpose of putting various resources under the same umbrella interface, though. In the example, the XMLNode is the bridge toward TagNode and Element. Consequently, the ElementAdapter is adapting the Element to the common XMLNodge bridge. This is a fine example how Bridge and Adapter may be combined together.