diff --git a/src/StrategyPattern/ShippingCalculator/ShippingWithStrategyExample.cs b/src/StrategyPattern/ShippingCalculator/ShippingWithStrategyExample.cs index b76800c..784e8f3 100644 --- a/src/StrategyPattern/ShippingCalculator/ShippingWithStrategyExample.cs +++ b/src/StrategyPattern/ShippingCalculator/ShippingWithStrategyExample.cs @@ -26,6 +26,9 @@ if you talk to train conductor:{3}, if you go to Ion {4}", indiaPrice, postaPric } } + /// + /// Context + /// public class ShippingCalculator { public double GetPrice(Order order, ShippingService shippingService) @@ -34,11 +37,17 @@ if you talk to train conductor:{3}, if you go to Ion {4}", indiaPrice, postaPric } } + /// + /// Strategy + /// public abstract class ShippingService { public abstract double GetPrice(Order o); } + /// + /// Concrete strategy + /// public class IndiaPost : ShippingService { public override double GetPrice(Order o) @@ -47,6 +56,9 @@ if you talk to train conductor:{3}, if you go to Ion {4}", indiaPrice, postaPric } } + /// + /// Concrete strategy + /// public class Posta : ShippingService { public override double GetPrice(Order o) @@ -55,6 +67,9 @@ if you talk to train conductor:{3}, if you go to Ion {4}", indiaPrice, postaPric } } + /// + /// Concrete strategy + /// public class TCE : ShippingService { public override double GetPrice(Order o) @@ -63,6 +78,9 @@ if you talk to train conductor:{3}, if you go to Ion {4}", indiaPrice, postaPric } } + /// + /// Concrete strategy using strategy pattern + /// public class SimpleService : ShippingService { Func simpleCalculator;