Architectural Patterns
上QQ阅读APP看书,第一时间看更新

Adapter class (wrapper)

Convert one interface of a class into another interface that the client wanted. In other words, the adapter makes heterogeneous classes work together:

The preceding class diagram depicts an adapter called OnlineLinkedAccounts that adopts a savings account's details and a target interface called credit card details, and combine the results to show both account numbers.