static void Main(string[] args) { CustomerFactory objBaseCust = new GoldCustomerFactory(); ICustomer objCust = objBaseCust.GetCustomer(); Console.ReadLine(); }
public void MainMethod() { /* Simple Factory*/ var obj = CustomerFactory.GetCustomer("gold"); /* Factory Method*/ BaseCustomerFactory baseCustomer = new GoldCustomerFactory(); var obj1 = baseCustomer.GetCustomer(); obj1.AddDiscount(); IMachineFactory factory = new LowBudgetMachine(); // or LowBudgetMachine() CoputerShopAbstractFactory shop = new CoputerShopAbstractFactory(factory); shop.AssembleMachine(); Console.ReadLine(); }