Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
NewCarForSale.java
NewCorvetteForSale.java
README.md
TestDrive.java
UsedCarForSale.java
UsedCarForSaleAdapter.java
UsedCorvetteForSale.java

README.md

DESIGN PATTERN - ADAPTER

TYPE - STRUCTURAL

The Adapter pattern converts the interface of a class into another interface the clients expect. Adapter lets classes work together that couldn't otherwise because of incompatible interfaces

Java JDK Examples include -

java.util.Arrays#asList() java.io.InputStreamReader(InputStream) (returns a Reader) java.io.OutputStreamWriter(OutputStream) (returns a Writer) javax.xml.bind.annotation.adapters.XmlAdapter#marshal() and #unmarshal()

Page 251 in Head First Design Patterns shows an Adapter for Iterator from Enumeration in Java API