cxlove / DesignPattern

The example code from head first design patterns for practicing
0 stars 2 forks source link

The Adapter Pattern using Java #14

Open cxlove opened 8 years ago

cxlove commented 8 years ago

RT

cxlove commented 8 years ago

type 1, object adapter using java

We can build a adapter implements the target interface and use the object composition to wrap the adaptee. This approach has the added advantage that we can use an adapter with any subclass of the adaptee.