From the course: Python: Design Patterns

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Adapter

Adapter

- [Speaker] The adapter pattern converts the interface of a class into another one a client is expecting. This time, our problem is that the interfaces are incompatible between a client and a server. In our scenario, we have Korean and British objects that have different method names for speaking. The client would like to use a uniform interface that is the speak method. Our solution is use the adapter pattern that translates the method names between the client and the server code. British and decorators are related to the adapter pattern.

Contents