Skip to content

Commit f7c2cad

Browse files
committed
Added explanation about class adapter vs. object adapter in the adapter
example.
1 parent da72f04 commit f7c2cad

File tree

1 file changed

+8
-2
lines changed
  • adapter/src/main/java/com/iluwatar

1 file changed

+8
-2
lines changed

adapter/src/main/java/com/iluwatar/App.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
/**
44
*
5-
* Adapter (GnomeEngineer) converts the interface of the
6-
* target class (GoblinGlider) into suitable one expected
5+
* There are two variations of the Adapter pattern: The
6+
* class adapter implements the adaptee's interface whereas
7+
* the object adapter uses composition to contain the adaptee
8+
* in the adapter object. This example uses the object adapter
9+
* approach.
10+
*
11+
* The Adapter (GnomeEngineer) converts the interface of the
12+
* target class (GoblinGlider) into a suitable one expected
713
* by the client (GnomeEngineeringManager).
814
*
915
*/

0 commit comments

Comments
 (0)