Skip to content

Commit 8cf35fc

Browse files
committed
Improve Decorator Javadoc
1 parent 621793e commit 8cf35fc

File tree

1 file changed

+7
-4
lines changed
  • decorator/src/main/java/com/iluwatar/decorator

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22

33
/**
44
*
5-
* Decorator pattern is a more flexible alternative to subclassing. The decorator
5+
* The Decorator pattern is a more flexible alternative to subclassing. The Decorator
66
* class implements the same interface as the target and uses composition to
7-
* "decorate" calls to the target.
7+
* "decorate" calls to the target. Using the Decorator pattern it is possible to
8+
* change the behavior of the class during runtime.
89
* <p>
9-
* Using decorator pattern it is possible to change class behavior during
10-
* runtime, as the example shows.
10+
* In this example we show how the simple {@link Troll} first attacks and then
11+
* flees the battle. Then we decorate the {@link Troll} with a {@link SmartTroll}
12+
* and perform the attack again. You can see how the behavior changes after the
13+
* decoration.
1114
*
1215
*/
1316
public class App {

0 commit comments

Comments
 (0)