public static CoffeeServiceLocator GetInstance() { if (locator == null) { locator = new CoffeeServiceLocator(); } return(locator); }
public static Coffee PrepareCoffee() { var coffeeMachine = CoffeeServiceLocator.GetInstance().GetCoffeeMachine(); Coffee coffee = coffeeMachine.BrewFilterCoffee(); Console.WriteLine("Coffee is ready!"); return(coffee); }