Skip to content

Commit

Permalink
Update App.java
Browse files Browse the repository at this point in the history
The relationship between decorator and target (in the code example between Troll und SmartTroll) ist not a composition as described in the code comment lines of class App. It's a aggregation. In a composition both instances canncot live without the other one. But the target (Troll) could live without the decorator (Smart Troll). Changed "composition" to "aggregation" in the comment lines. Code lines are unchanged.
Greetings Thomas
  • Loading branch information
thomasoss authored Nov 14, 2016
1 parent e1ae106 commit 9180bb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion decorator/src/main/java/com/iluwatar/decorator/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
*
* 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
* implements the same interface as the target and uses aggregation to "decorate" calls to the
* target. Using the Decorator pattern it is possible to change the behavior of the class during
* runtime.
* <p>
Expand Down

0 comments on commit 9180bb0

Please sign in to comment.