Improve Decorator Javadoc

This commit is contained in:
Ilkka Seppala 2015-10-03 20:43:38 +03:00
parent 621793ed2d
commit 8cf35fc315

View File

@ -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 * 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.
* <p> * <p>
* Using decorator pattern it is possible to change class behavior during * In this example we show how the simple {@link Troll} first attacks and then
* runtime, as the example shows. * 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 { public class App {