Esempio n. 1
0
/*
  main()
//*/
int main()
{
  using namespace std;

  // init
  cout << "init..\n";
  Director director;
  std::auto_ptr< Product > product;
  cout << endl;

  // builder A
  cout << "builder A\n";
  ConcreteBuilderA concBuilderA;
  director.setBuilder( &concBuilderA);
  director.construct();
  product = director.getProduct();
  product->showProduct();
  cout << endl;

  // builder B
  cout << "builder B\n";
  ConcreteBuilderB concBuilderB;
  director.setBuilder( &concBuilderB);
  director.construct();
  product = director.getProduct();
  product->showProduct();
  cout << endl;

  cout << "READY.\n";
  return 0;
}
int main()
{
	Korean korean;
	American american;
	Director director;

	director.setBuilder(&korean);
	cout << director.construct() << endl;

	director.setBuilder(&american);
	cout << director.construct() << endl;
}