Skip to content

Commit

Permalink
Improve Decorator Javadoc
Browse files Browse the repository at this point in the history
  • Loading branch information
iluwatar committed Oct 3, 2015
1 parent 621793e commit 8cf35fc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions decorator/src/main/java/com/iluwatar/decorator/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

/**
*
* 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.
* <p>
* 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 {
Expand Down

0 comments on commit 8cf35fc

Please sign in to comment.