File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
strategy/src/main/java/com/iluwatar Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 11package com .iluwatar ;
22
3+ /**
4+ *
5+ * Strategy (DragonSlayingStrategy) encapsulates the algorithm to use.
6+ * The object (DragonSlayer) can alter its behavior by changing its strategy.
7+ *
8+ */
39public class App
410{
511 public static void main ( String [] args )
Original file line number Diff line number Diff line change 11package com .iluwatar ;
22
3+ /**
4+ *
5+ * DragonSlayer uses different strategies to slay the dragon.
6+ *
7+ */
38public class DragonSlayer {
49
510 private DragonSlayingStrategy strategy ;
Original file line number Diff line number Diff line change 11package com .iluwatar ;
22
3+ /**
4+ *
5+ * Strategy interface.
6+ *
7+ */
38public interface DragonSlayingStrategy {
49
510 void execute ();
You can’t perform that action at this time.
0 commit comments