public void TestVersion01(string hostingPlan) { HostingPlanAbstractFactory hostingFactory = HostingPlanAbstractFactory.GetHostingFactory(hostingPlan); EconomyHostingPlan economyHostingPlan = hostingFactory.CreateEconomyHosting(); Debug.WriteLine(economyHostingPlan.GetFeatures()); DeluxeHostingPlan deluxeHostingPlan = hostingFactory.CreateDeluxeHosting(); Debug.WriteLine(deluxeHostingPlan.GetFeatures()); UltimateHostingPlan ultimateHostingPlan = hostingFactory.CreateUltimateHosting(); Debug.WriteLine(ultimateHostingPlan.GetFeatures()); }
static void Main(string[] args) { String hostingPlan = hosting.Default.HostingOS; HostingPlanAbstractFactory hostingFactory = HostingPlanAbstractFactory.getHostingFactory(hostingPlan); EconomyHostingPlan economyHostingPlan = hostingFactory.createEconomyHosting(); Console.WriteLine(economyHostingPlan.getFeatures()); DeluxeHostingPlan deluxeHostingPlan = hostingFactory.createDeluxeHosting(); Console.WriteLine(deluxeHostingPlan.GetFeatures()); UltimateHostingPlan ultimateHostingPlan = hostingFactory.createUltimateHosting(); Console.WriteLine(ultimateHostingPlan.getFeatures()); Console.ReadKey(); }
static void Main(string[] args) { initialize(); String hostingPlan = Environment.GetEnvironmentVariable("HostingOS"); HostingPlanAbstractFactory hostingFactory = HostingPlanAbstractFactory.GetHostingFactory(hostingPlan); EconomyHostingPlan economyHostingPlan = hostingFactory.CreateEconomyHosting(); Console.WriteLine(economyHostingPlan.GetFeatures()); DeluxeHostingPlan deluxeHostingPlan = hostingFactory.CreateDeluxeHosting(); Console.WriteLine(deluxeHostingPlan.GetFeatures()); UltimateHostingPlan ultimateHostingPlan = hostingFactory.CreateUltimateHosting(); Console.WriteLine(ultimateHostingPlan.GetFeatures()); Console.ReadKey(); }
static void Main(string[] args) { Console.WriteLine("Hello AbstractFactoryMethod World!"); String hostingPlan = "Windows"; HostingPlanAbstractFactory hostingFactory = HostingPlanAbstractFactory.getHostingFactory(hostingPlan); EconomyHostingPlan economyHostingPlan = hostingFactory.createEconomyHosting(); Console.WriteLine(economyHostingPlan.getFeatures()); DeluxeHostingPlan deluxeHostingPlan = hostingFactory.createDeluxeHosting(); Console.WriteLine(deluxeHostingPlan.getFeatures()); UltimateHostingPlan ultimateHostingPlan = hostingFactory.createUltimateHosting(); Console.WriteLine(ultimateHostingPlan.getFeatures()); }