Example #1
0
 public void BeginBuild(ComplexProduct existingComplexProduct = null)
 {
     if (existingComplexProduct == null)
     {
         _complexProduct = new ComplexProduct();
     }
     else
     {
         _complexProduct = existingComplexProduct;
     }
 }
Example #2
0
        public void TestCase2()
        {
            AbstractComplexProductBuilder  builder  = new ConcreteProductBuilderA("Sunday", 9);
            GoodWeatherAndGoodLuckDirector director = new GoodWeatherAndGoodLuckDirector();

            builder.BeginBuild();
            director.ConstructWithGoodWeatherAndGoodLuck(builder);
            ComplexProduct productWithGoodLuck = builder.EndBuild();

            builder.BeginBuild();
            director.ConstructWithBadWeatherAndBadLuck(builder);
            ComplexProduct productWithBadLuck = builder.EndBuild();
        }