Skip to content

Commit 623c208

Browse files
committed
Update App.java to have more information on the pattern iluwatar#324
1 parent dec5ff2 commit 623c208

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

  • delegation/src/main/java/com/iluwatar/delegation/simple

delegation/src/main/java/com/iluwatar/delegation/simple/App.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
import com.iluwatar.delegation.simple.printers.HpPrinter;
66

77
/**
8+
* The delegate pattern provides a mechanism to abstract away the implementation and control of the desired action.
9+
* The class being called in this case {@link PrinterController} is not responsible for the actual desired action,
10+
* but is actually delegated to a helper class either {@link CanonPrinter}, {@link EpsonPrinter} or {@link HpPrinter}.
11+
* The consumer does not have or require knowledge of the actual class carrying out the action, only the
12+
* container on which they are calling.
13+
*
814
* In this example the delegates are {@link EpsonPrinter}, {@link HpPrinter} and {@link CanonPrinter} they all implement
9-
* {@link Printer}. The {@link AbstractPrinterController} and through inheritance {@link PrinterController} also
10-
* implement {@link Printer}. However neither provide the functionality of {@link Printer} by printing to the screen,
11-
* they actually call upon the instance of {@link Printer} that they were instantiated with. Therefore delegating the
12-
* behaviour to another class.
15+
* {@link Printer}. The {@link PrinterController} class also implements {@link Printer}. However neither provide the
16+
* functionality of {@link Printer} by printing to the screen, they actually call upon the instance of {@link Printer}
17+
* that they were instantiated with. Therefore delegating the behaviour to another class.
1318
*/
1419
public class App {
1520

0 commit comments

Comments
 (0)