O'Reilly logo

Swift 2 Design Patterns by Julien Lange

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Structural Patterns – Adapter and Facade

In this chapter, we will discuss two new structural patterns: the adapter and facade patterns. We will focus on the adapter pattern that joins together types that were not designed to work with each other. Then, we will discuss the facade pattern that simplifies the interface of a set of complex systems.

The adapter pattern

This pattern is often used when dealing with frameworks, libraries, and APIs to easily "adapt" the old and existing interfaces to the new requirements of a program.

Roles

The adapter pattern converts the interface of another existing class into an interface waited by the existing clients to allow them to work together. Thanks to this pattern, you can integrate components for which ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required