コード例 #1
0
        public Meal prepare()
        {
            IUtensil utensil = ProvideUtensil();
            ISpice   spice   = ProvideSpice();

            // now do whatever steps are needed to prepare the meal...
            return(new Meal());
        }
コード例 #2
0
        public Meal Prepare(Func <IUtensil> utensilSupplier, Func <ISpice> spiceSupplier)
        {
            ISpice   spice   = spiceSupplier.Invoke();
            IUtensil utensil = utensilSupplier.Invoke();

            // now do whatever steps are needed to prepare the meal...

            return(new Meal());
        }