diff --git a/src/StrategyPattern/StrategyPatternExamples.cs b/src/StrategyPattern/StrategyPatternExamples.cs index 59a2b6a..906bcea 100644 --- a/src/StrategyPattern/StrategyPatternExamples.cs +++ b/src/StrategyPattern/StrategyPatternExamples.cs @@ -6,16 +6,43 @@ using System.Threading.Tasks; namespace StrategyPattern { + /// + /// Client + /// public class StrategyPatternExamples { public static void Run() { + Console.WriteLine(GetDescription()); + Console.WriteLine(WhenToUse()); + GoToNextStep(); ShippingMotivatingExample.Run(); ShippingWithStrategyExample.Run(); - //TODO: use actions/funcs, add more examples + //TODO:add more examples //Show the switch moving problem } + + private static string GetDescription() + { + return @"Strategy pattern (also known as the policy pattern) is a software design pattern +that enables an algorithm's behavior to be selected at runtime. The strategy pattern +defines a family of algorithms, +encapsulates each algorithm, and +makes the algorithms interchangeable within that family."; + } + + public static string WhenToUse() + { + return @"Whenever you start to use a switch statement you should ask yourself whether you can use Strategy Pattern instead. "; + } + + + private static void GoToNextStep() + { + Console.ReadKey(); + Console.Clear(); + } } }