Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9180bb0

Browse files
authored
Update App.java
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
1 parente1ae106 commit9180bb0

File tree

1 file changed

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

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/**
2626
*
2727
* The Decorator pattern is a more flexible alternative to subclassing. The Decorator class
28-
* implements the same interface as the target and usescomposition to "decorate" calls to the
28+
* implements the same interface as the target and usesaggregation to "decorate" calls to the
2929
* target. Using the Decorator pattern it is possible to change the behavior of the class during
3030
* runtime.
3131
* <p>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp