static void Main(string[] args) { Logistics r = new RoadLogistics(); Logistics s = new SeaLogistics(); r.PlanDelivery(); Console.WriteLine(); Console.WriteLine(); Console.WriteLine(); Console.WriteLine(); s.PlanDelivery(); }
static void FactoryMethodExample() { var roadLogistics = new RoadLogistics(); roadLogistics.PlanDelivery(); var truck = roadLogistics.FactoryMethod(); var seaLogistics = new SeaLogistics(); seaLogistics.PlanDelivery(); var ship = seaLogistics.FactoryMethod(); }