Skip to content

Commit 94b2898

Browse files
committed
Comments for the strategy example.
1 parent 4debc8e commit 94b2898

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

strategy/src/main/java/com/iluwatar/App.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
package 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+
*/
39
public class App
410
{
511
public static void main( String[] args )

strategy/src/main/java/com/iluwatar/DragonSlayer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* DragonSlayer uses different strategies to slay the dragon.
6+
*
7+
*/
38
public class DragonSlayer {
49

510
private DragonSlayingStrategy strategy;

strategy/src/main/java/com/iluwatar/DragonSlayingStrategy.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
package com.iluwatar;
22

3+
/**
4+
*
5+
* Strategy interface.
6+
*
7+
*/
38
public interface DragonSlayingStrategy {
49

510
void execute();

0 commit comments

Comments
 (0)