Home  /  Questions  /  Question



88   96.5
Feb 07, 2012


Call Different Count Methods on Builder Pattern

Hi ,
 In  dofactory pattern examples which name is builder pattern like below, i want to call methods like that.

   For example :
       MotorCycleBuilder  i want to call     vehicleBuilder.BuildFrame();  vehicleBuilder.BuildEngine();
       CarBuilder i want to call            vehicleBuilder.BuildFrame(); vehicleBuilder.BuildEngine();   vehicleBuilder.BuildWheels();
        
       ScooterBuilder i want to call      vehicleBuilder.BuildFrame(); vehicleBuilder.BuildEngine();  vehicleBuilder.BuildWheels(); vehicleBuilder.BuildDoors();   like these methods.

      Shortly i want to call different combinations  of these methods  on Builder Directors .How can i do or is there a pattern?
  

   class Shop

  {

    // Builder uses a complex series of steps

    public void Construct(VehicleBuilder vehicleBuilder)

    {

      vehicleBuilder.BuildFrame();

      vehicleBuilder.BuildEngine();

      vehicleBuilder.BuildWheels();

      vehicleBuilder.BuildDoors();

    }

  }


thanks.


Best Regards.





88   96.5
Feb 07, 2012
:(  sorry for the silly question ,i found there has been TemplateMethodPattern , dont care it