https://github.com/quynhchi1009/adapter
Adapter is a special object that converts the interface of one object so that another object can understand it.
https://github.com/quynhchi1009/adapter
adapter-pattern design-patterns
Last synced: 6 months ago
JSON representation
Adapter is a special object that converts the interface of one object so that another object can understand it.
- Host: GitHub
- URL: https://github.com/quynhchi1009/adapter
- Owner: quynhchi1009
- Created: 2022-12-29T10:37:28.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-12-29T10:39:22.000Z (over 3 years ago)
- Last Synced: 2025-01-14T22:51:50.748Z (over 1 year ago)
- Topics: adapter-pattern, design-patterns
- Language: Java
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Adapter
Adapter is a special object that converts the interface of one object so that another object can understand it.
!! an object allows objects with incompatible interfaces to collaborate
1. The adapter gets an interface, compatible with one of the existing objects.
2. Using this interface, the existing object can safely call the adapter’s methods
3. Upon receiving a call, the adapter passes the request to the second object, but in a format and order that the second object expects.
### ****Applicability****
- when you want to use some existing class, but its interface isn’t compatible with the rest of your code
- when you want to reuse several existing subclasses that lack some common functionality that can’t be added to the superclass