File tree Expand file tree Collapse file tree
delegation/src/main/java/com/iluwatar/delegation/simple Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import 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 */
1419public class App {
1520
You can’t perform that action at this time.
0 commit comments