public void Facade_without_design()
        {
            /* client part */
            var coldAppID   = 1;
            var hotEntreeID = 2;
            var drinkID     = 3;
            /************* */

            var chief = new Chief("Foo");

            //place the order ("Passer la commande")
            var coldPrep = new ColdPrep();
            var bar      = new Bar();
            var hotPrep  = new HotPrep();

            Console.WriteLine("{0} places order for cold app #" + coldAppID.ToString()
                              + ", hot entree #" + hotEntreeID.ToString()
                              + ", and drink #" + drinkID.ToString() + ".", chief.Name);

            Order order = new Order();

            order.Appetizer = coldPrep.PrepDish(coldAppID);
            order.Entree    = hotPrep.PrepDish(hotEntreeID);
            order.Drink     = bar.PrepDish(drinkID);
        }
Example #2
0
        public Order PlaceOrder(Patron patron, int coldAppID, int hotEntreeID, int drinkID)
        {
            Console.WriteLine("{0} places order for cold app #" + coldAppID.ToString()
                              + ", hot entree #" + hotEntreeID.ToString()
                              + ", and drink #" + drinkID.ToString() + ".", patron.Name);

            Order order = new Order();

            order.Appetizer = _coldPrep.PrepDish(coldAppID);
            order.Entree    = _hotPrep.PrepDish(hotEntreeID);
            order.Drink     = _bar.PrepDish(drinkID);

            return(order);
        }
        public Order PlaceOrder(Customer customer,
                                int coldAppId,
                                int hotEntreeId,
                                int drinkId)
        {
            Console.WriteLine("{0} places order for cold app #"
                              + coldAppId.ToString()
                              + ", hot entree #" + hotEntreeId.ToString()
                              + ", and drink #" + drinkId.ToString(), customer.Name);

            Order order = new Order();

            order.Appetizer = _coldPrep.PrepDish(coldAppId);
            order.Entree    = _hotPrep.PrepDish(hotEntreeId);
            order.Drink     = _bar.PrepDish(drinkId);

            return(order);
        }