Overview

I will continue our study of design patterns with the Adapter pattern. The Adapter pattern is a very common pattern, and, as you will see, it is used with many other patterns.

  • I explain what the Adapter pattern is, where it is used, and how it is implemented.

  • I present the key features of the pattern.

  • I use the pattern to illustrate polymorphism.

  • I illustrate how the UML can be used at different levels of detail.

  • I present some observations on the Adapter pattern from my own practice, including a comparison of the Adapter pattern and the Facade pattern.

  • I relate the Adapter pattern to the CAD/CAM problem.

Note: I will only show Java code examples in the main body of this chapter. The equivalent C++ code examples can be found at the end of ...

Get Design Patterns Explained: A New Perspective on Object-Oriented Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.