Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, Second Edition
by Craig Larman
23.1. Adapter (GoF)
The problem explored in the previous chapter to motivate the Polymorphism pattern, and its solution, is more specifically an example of the GoF Adapter pattern.
|
Adapter Context/Problem How to resolve incompatible interfaces, or provide a stable interface to similar components with different interfaces? Solution Convert the original interface of a component into another interface, through an intermediate adapter object. |
To review: The NextGen POS system needs to support several kinds of external third-party services, including tax calculators, credit authorization services, inventory systems, and accounting systems, among others. Each has a different API, which can't be changed.
A solution is to add a level of indirection ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access