Comments for the strategy example.
This commit is contained in:
@ -1,5 +1,11 @@
|
||||
package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* Strategy (DragonSlayingStrategy) encapsulates the algorithm to use.
|
||||
* The object (DragonSlayer) can alter its behavior by changing its strategy.
|
||||
*
|
||||
*/
|
||||
public class App
|
||||
{
|
||||
public static void main( String[] args )
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* DragonSlayer uses different strategies to slay the dragon.
|
||||
*
|
||||
*/
|
||||
public class DragonSlayer {
|
||||
|
||||
private DragonSlayingStrategy strategy;
|
||||
|
@ -1,5 +1,10 @@
|
||||
package com.iluwatar;
|
||||
|
||||
/**
|
||||
*
|
||||
* Strategy interface.
|
||||
*
|
||||
*/
|
||||
public interface DragonSlayingStrategy {
|
||||
|
||||
void execute();
|
||||
|
Reference in New Issue
Block a user