Exemplo n.º 1
0
        static void Main(string[] args)
        {
            ProductBuilder builder = new ProductBuilder();
            Product product = BuildProduct(builder);

            OtherProductBuilder counter = new OtherProductBuilder();
            BuildProduct(counter);

            int prod1Count = 0;
            int prod2Count = 0;
            int prod3Count = 0;
            counter.GetProductsCount(out prod1Count, out prod2Count, out prod3Count);
            Console.WriteLine("Product 1 Count = " + prod1Count);
            Console.WriteLine("Product 2 Count = " + prod2Count);
            Console.WriteLine("Product 3 Count = " + prod3Count);

            Console.ReadLine();
        }
Exemplo n.º 2
0
 public Product GenerateProduct(ProductBuilder builder, Product product)
 {
     return(builder.ApplyDiscount(product));
 }
Exemplo n.º 3
0
 public void GeneratedProduct(ProductBuilder productBuilder)
 {
     productBuilder.GetProductData();
     productBuilder.ApplyDiscount();
 }