From 8cf35fc315c595b6d8f3a2cfd3b744756c94df4d Mon Sep 17 00:00:00 2001 From: Ilkka Seppala Date: Sat, 3 Oct 2015 20:43:38 +0300 Subject: [PATCH] Improve Decorator Javadoc --- .../src/main/java/com/iluwatar/decorator/App.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/decorator/src/main/java/com/iluwatar/decorator/App.java b/decorator/src/main/java/com/iluwatar/decorator/App.java index a9eabf606..bd697d4a4 100644 --- a/decorator/src/main/java/com/iluwatar/decorator/App.java +++ b/decorator/src/main/java/com/iluwatar/decorator/App.java @@ -2,12 +2,15 @@ package com.iluwatar.decorator; /** * - * Decorator pattern is a more flexible alternative to subclassing. The decorator + * The Decorator pattern is a more flexible alternative to subclassing. The Decorator * class implements the same interface as the target and uses composition to - * "decorate" calls to the target. + * "decorate" calls to the target. Using the Decorator pattern it is possible to + * change the behavior of the class during runtime. *

- * Using decorator pattern it is possible to change class behavior during - * runtime, as the example shows. + * In this example we show how the simple {@link Troll} first attacks and then + * flees the battle. Then we decorate the {@link Troll} with a {@link SmartTroll} + * and perform the attack again. You can see how the behavior changes after the + * decoration. * */ public class App {