Beispiel #1
0
        static void Main(string[] args)
        {
            ProductDirector director = new ProductDirector();
            var             builder  = new OldCustomerProductBuilder();

            director.GenerateProduct(builder);
            var model = builder.GetModel();

            Console.WriteLine(model.Id);
            Console.WriteLine(model.CategoryName);
            Console.WriteLine(model.DiscountApplied);
            Console.WriteLine(model.DiscountedPrice);
            Console.WriteLine(model.ProductName);
            Console.WriteLine(model.UnitPrice);
            Console.ReadLine();
        }
        static void Main(string[] args)
        {
            //İş ve arayüz katmanlarında ortaya bi nesnenin çıkarılması için
            ProductDirector director = new ProductDirector();
            var             builder  = new NewCustomerProductBuilder();

            director.GenerateProduct(builder);
            var model = builder.GetModel();

            Console.WriteLine(model.UnitPrice);
            Console.WriteLine(model.CategoryName);
            Console.WriteLine(model.Id);
            Console.WriteLine(model.Discount);

            Console.ReadLine();
        }