mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-12 19:06:24 +02:00
README Adapter
This commit is contained in:
@ -5,7 +5,7 @@ namespace DesignPatterns\Adapter;
|
|||||||
/**
|
/**
|
||||||
* EBookAdapter is an adapter to fit an e-book like a paper book
|
* EBookAdapter is an adapter to fit an e-book like a paper book
|
||||||
*
|
*
|
||||||
* This is the adapter here. Notice it implemennts PaperBookInterface,
|
* This is the adapter here. Notice it implements PaperBookInterface,
|
||||||
* therefore you don't have to change the code of the client which using paper book.
|
* therefore you don't have to change the code of the client which using paper book.
|
||||||
*/
|
*/
|
||||||
class EBookAdapter implements PaperBookInterface
|
class EBookAdapter implements PaperBookInterface
|
||||||
|
10
Adapter/README.md
Normal file
10
Adapter/README.md
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Adapter / Wrapper
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
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 it's interface to clients while using the original interface.
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
* DB Client libraries adapter
|
||||||
|
* using multiple different webservices and adapters normalize data so that the outcome is the same for all
|
Reference in New Issue
Block a user