/swiftAdapterDP

🔌 object Adapter Design Pattern, in Swift 3.0

Primary LanguageSwift

Adapter Design Pattern, in Swift 3.0

This is a Structural Design Pattern

Inspired on github ochococo/Design-Patterns-In-Swift

Pattern Definition

The adapter pattern is used to provide a link between two otherwise incompatible types by wrapping the "adaptee" with a class that supports the interface required by the client.

Class Diagram

Adapter Design Pattern class diagram

Class Diagram for OldDeathStar Adapter example (@ochococo)

Implementation Details

I implemented a second example, the one present in Design Patterns book by Head First. An implementation in Java can be found in github:adagio/javaAdapterDP

Other examples