Skip to content

Commit

Permalink
Update App.java to have more information on the pattern iluwatar#324
Browse files Browse the repository at this point in the history
  • Loading branch information
mikulucky committed Dec 30, 2015
1 parent dec5ff2 commit 623c208
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions delegation/src/main/java/com/iluwatar/delegation/simple/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
import com.iluwatar.delegation.simple.printers.HpPrinter;

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

Expand Down

0 comments on commit 623c208

Please sign in to comment.