To translate one interface for a class into a compatible interface. An adapter allows classes to work together that normally could not because of incompatible interfaces by providing its interface to clients while using the original interface.
- DB Client libraries adapter
- using multiple different webservices and adapters normalize data so that the outcome is the same for all
You can also find this code on GitHub
Book.php
Book.php
PaperBook.php
PaperBook.php
EBook.php
EBook.php
EBookAdapter.php
EBookAdapter.php
Kindle.php
Kindle.php
Tests/AdapterTest.php
Tests/AdapterTest.php